From d3cf31b348ea0e1b996a23062c4abec2ece154c6 Mon Sep 17 00:00:00 2001 From: omarkasem Date: Sat, 7 Sep 2024 09:24:47 +0300 Subject: [PATCH 01/37] Testing --- assets/js/fe-views.js | 27 + composer.lock | 761 ++++++++++-------- .../edit-entry/partials/inline-javascript.php | 2 + 3 files changed, 437 insertions(+), 353 deletions(-) diff --git a/assets/js/fe-views.js b/assets/js/fe-views.js index 454dd69dd0..d30cc1bc3c 100644 --- a/assets/js/fe-views.js +++ b/assets/js/fe-views.js @@ -31,10 +31,37 @@ jQuery( function ( $ ) { $( '.gv-search-clear' ).on( 'click', this.clear_search ); $( 'a.gv-sort' ).on( 'click', this.multiclick_sort ); + + // this.multi_file_upload(); this.number_range(); }, + multi_file_upload: function(){ + if (typeof gfMultiFileUploader === 'undefined' || !gfMultiFileUploader || !gfMultiFileUploader.uploaders || gfMultiFileUploader.uploaders.length === 0) { + return; + } + + var checkUploaders = setInterval(function() { + if (gfMultiFileUploader.uploaders && Object.keys(gfMultiFileUploader.uploaders).length > 0) { + $.each(gfMultiFileUploader.uploaders, function(index, uploader){ + uploader.bind( 'Init', function( up, params ) { + var limit = parseInt(uploader.settings.gf_vars.max_files, 10); + if (limit <= 0) { + return; + } + + var fieldId = uploader.settings.multipart_params.field_id; + var totalCount = $('#preview_existing_files_'+fieldId).children().length; + var limitReached = totalCount >= limit; + gfMultiFileUploader.toggleDisabled(uploader.settings, limitReached); + }); + }); + clearInterval(checkUploaders); + } + }, 100); + }, + /** * Triggered when the search form changes * - Adds 'data-form-changed' attribute to
wrapper diff --git a/composer.lock b/composer.lock index d25a327332..ad0a75784f 100644 --- a/composer.lock +++ b/composer.lock @@ -1995,16 +1995,16 @@ }, { "name": "composer/ca-bundle", - "version": "1.5.0", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99" + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", - "reference": "0c5ccfcfea312b5c5a190a21ac5cef93f74baf99", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/063d9aa8696582f5a41dffbbaf3c81024f0a604a", + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a", "shasum": "" }, "require": { @@ -2014,7 +2014,7 @@ }, "require-dev": { "phpstan/phpstan": "^1.10", - "psr/log": "^1.0", + "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/phpunit-bridge": "^4.2 || ^5", "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, @@ -2051,7 +2051,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.5.0" + "source": "https://github.com/composer/ca-bundle/tree/1.5.1" }, "funding": [ { @@ -2067,20 +2067,20 @@ "type": "tidelift" } ], - "time": "2024-03-15T14:00:32+00:00" + "time": "2024-07-08T15:28:20+00:00" }, { "name": "composer/composer", - "version": "2.2.23", + "version": "2.2.24", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "d1542e89636abf422fde328cb28d53752efb69e5" + "reference": "91d9d38ebc274267f952ee1fd3892dc7962075f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/d1542e89636abf422fde328cb28d53752efb69e5", - "reference": "d1542e89636abf422fde328cb28d53752efb69e5", + "url": "https://api.github.com/repos/composer/composer/zipball/91d9d38ebc274267f952ee1fd3892dc7962075f4", + "reference": "91d9d38ebc274267f952ee1fd3892dc7962075f4", "shasum": "" }, "require": { @@ -2150,7 +2150,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/composer/issues", - "source": "https://github.com/composer/composer/tree/2.2.23" + "source": "https://github.com/composer/composer/tree/2.2.24" }, "funding": [ { @@ -2166,7 +2166,7 @@ "type": "tidelift" } ], - "time": "2024-02-08T14:08:53+00:00" + "time": "2024-06-10T20:51:52+00:00" }, { "name": "composer/metadata-minifier", @@ -2310,16 +2310,16 @@ }, { "name": "composer/semver", - "version": "3.4.0", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32" + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/35e8d0af4486141bc745f23a29cc2091eb624a32", - "reference": "35e8d0af4486141bc745f23a29cc2091eb624a32", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "shasum": "" }, "require": { @@ -2371,7 +2371,7 @@ "support": { "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.4.0" + "source": "https://github.com/composer/semver/tree/3.4.2" }, "funding": [ { @@ -2387,7 +2387,7 @@ "type": "tidelift" } ], - "time": "2023-08-31T09:50:34+00:00" + "time": "2024-07-12T11:35:52+00:00" }, { "name": "composer/spdx-licenses", @@ -2471,16 +2471,16 @@ }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { @@ -2491,7 +2491,7 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -2515,9 +2515,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -2533,7 +2533,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -2786,22 +2786,22 @@ }, { "name": "guzzlehttp/guzzle", - "version": "7.8.1", + "version": "7.9.2", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104" + "reference": "d281ed313b989f213357e3be1a179f02196ac99b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/41042bc7ab002487b876a0683fc8dce04ddce104", - "reference": "41042bc7ab002487b876a0683fc8dce04ddce104", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/d281ed313b989f213357e3be1a179f02196ac99b", + "reference": "d281ed313b989f213357e3be1a179f02196ac99b", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.5.3 || ^2.0.1", - "guzzlehttp/psr7": "^1.9.1 || ^2.5.1", + "guzzlehttp/promises": "^1.5.3 || ^2.0.3", + "guzzlehttp/psr7": "^2.7.0", "php": "^7.2.5 || ^8.0", "psr/http-client": "^1.0", "symfony/deprecation-contracts": "^2.2 || ^3.0" @@ -2812,9 +2812,9 @@ "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "php-http/client-integration-tests": "dev-master#2c025848417c1135031fdf9c728ee53d0a7ceaee as 3.0.999", + "guzzle/client-integration-tests": "3.0.2", "php-http/message-factory": "^1.1", - "phpunit/phpunit": "^8.5.36 || ^9.6.15", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { @@ -2892,7 +2892,7 @@ ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/7.8.1" + "source": "https://github.com/guzzle/guzzle/tree/7.9.2" }, "funding": [ { @@ -2908,20 +2908,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:35:24+00:00" + "time": "2024-07-24T11:22:20+00:00" }, { "name": "guzzlehttp/promises", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223" + "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/bbff78d96034045e58e13dedd6ad91b5d1253223", - "reference": "bbff78d96034045e58e13dedd6ad91b5d1253223", + "url": "https://api.github.com/repos/guzzle/promises/zipball/6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", + "reference": "6ea8dd08867a2a42619d65c3deb2c0fcbf81c8f8", "shasum": "" }, "require": { @@ -2929,7 +2929,7 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "type": "library", "extra": { @@ -2975,7 +2975,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/2.0.2" + "source": "https://github.com/guzzle/promises/tree/2.0.3" }, "funding": [ { @@ -2991,20 +2991,20 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:19:20+00:00" + "time": "2024-07-18T10:29:17+00:00" }, { "name": "guzzlehttp/psr7", - "version": "2.6.2", + "version": "2.7.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221" + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/45b30f99ac27b5ca93cb4831afe16285f57b8221", - "reference": "45b30f99ac27b5ca93cb4831afe16285f57b8221", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/a70f5c95fb43bc83f07c9c948baa0dc1829bf201", + "reference": "a70f5c95fb43bc83f07c9c948baa0dc1829bf201", "shasum": "" }, "require": { @@ -3019,8 +3019,8 @@ }, "require-dev": { "bamarni/composer-bin-plugin": "^1.8.2", - "http-interop/http-factory-tests": "^0.9", - "phpunit/phpunit": "^8.5.36 || ^9.6.15" + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.39 || ^9.6.20" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" @@ -3091,7 +3091,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/2.6.2" + "source": "https://github.com/guzzle/psr7/tree/2.7.0" }, "funding": [ { @@ -3107,24 +3107,24 @@ "type": "tidelift" } ], - "time": "2023-12-03T20:05:35+00:00" + "time": "2024-07-18T11:15:46+00:00" }, { "name": "justinrainbow/json-schema", - "version": "v5.2.13", + "version": "5.3.0", "source": { "type": "git", - "url": "https://github.com/justinrainbow/json-schema.git", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793" + "url": "https://github.com/jsonrainbow/json-schema.git", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/fbbe7e5d79f618997bc3332a6f49246036c45793", - "reference": "fbbe7e5d79f618997bc3332a6f49246036c45793", + "url": "https://api.github.com/repos/jsonrainbow/json-schema/zipball/feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", + "reference": "feb2ca6dd1cebdaf1ed60a4c8de2e53ce11c4fd8", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": ">=7.1" }, "require-dev": { "friendsofphp/php-cs-fixer": "~2.2.20||~2.15.1", @@ -3135,11 +3135,6 @@ "bin/validate-json" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.0.x-dev" - } - }, "autoload": { "psr-4": { "JsonSchema\\": "src/JsonSchema/" @@ -3174,10 +3169,10 @@ "schema" ], "support": { - "issues": "https://github.com/justinrainbow/json-schema/issues", - "source": "https://github.com/justinrainbow/json-schema/tree/v5.2.13" + "issues": "https://github.com/jsonrainbow/json-schema/issues", + "source": "https://github.com/jsonrainbow/json-schema/tree/5.3.0" }, - "time": "2023-09-26T02:20:38+00:00" + "time": "2024-07-06T21:00:26+00:00" }, { "name": "lucatume/wp-browser", @@ -3274,16 +3269,16 @@ }, { "name": "mck89/peast", - "version": "v1.16.2", + "version": "v1.16.3", "source": { "type": "git", "url": "https://github.com/mck89/peast.git", - "reference": "2791b08ffcc1862fe18eef85675da3aa58c406fe" + "reference": "645ec21b650bc2aced18285c85f220d22afc1430" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mck89/peast/zipball/2791b08ffcc1862fe18eef85675da3aa58c406fe", - "reference": "2791b08ffcc1862fe18eef85675da3aa58c406fe", + "url": "https://api.github.com/repos/mck89/peast/zipball/645ec21b650bc2aced18285c85f220d22afc1430", + "reference": "645ec21b650bc2aced18285c85f220d22afc1430", "shasum": "" }, "require": { @@ -3296,7 +3291,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.16.2-dev" + "dev-master": "1.16.3-dev" } }, "autoload": { @@ -3317,9 +3312,9 @@ "description": "Peast is PHP library that generates AST for JavaScript code", "support": { "issues": "https://github.com/mck89/peast/issues", - "source": "https://github.com/mck89/peast/tree/v1.16.2" + "source": "https://github.com/mck89/peast/tree/v1.16.3" }, - "time": "2024-03-05T09:16:03+00:00" + "time": "2024-07-23T14:00:32+00:00" }, { "name": "mikemclin/laravel-wp-password", @@ -3438,16 +3433,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -3455,11 +3450,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -3485,7 +3481,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -3493,7 +3489,7 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "nb/oxymel", @@ -3787,28 +3783,28 @@ }, { "name": "phpcompatibility/phpcompatibility-paragonie", - "version": "1.3.2", + "version": "1.3.3", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie.git", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26" + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", - "reference": "bba5a9dfec7fcfbd679cfaf611d86b4d3759da26", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityParagonie/zipball/293975b465e0e709b571cbf0c957c6c0a7b9a2ac", + "reference": "293975b465e0e709b571cbf0c957c6c0a7b9a2ac", "shasum": "" }, "require": { "phpcompatibility/php-compatibility": "^9.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", "paragonie/random_compat": "dev-master", "paragonie/sodium_compat": "dev-master" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -3838,22 +3834,37 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibilityParagonie" }, - "time": "2022-10-25T01:46:02+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:30:46+00:00" }, { "name": "phpcompatibility/phpcompatibility-wp", - "version": "2.1.4", + "version": "2.1.5", "source": { "type": "git", "url": "https://github.com/PHPCompatibility/PHPCompatibilityWP.git", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5" + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", - "reference": "b6c1e3ee1c35de6c41a511d5eb9bd03e447480a5", + "url": "https://api.github.com/repos/PHPCompatibility/PHPCompatibilityWP/zipball/01c1ff2704a58e46f0cb1ca9d06aee07b3589082", + "reference": "01c1ff2704a58e46f0cb1ca9d06aee07b3589082", "shasum": "" }, "require": { @@ -3861,10 +3872,10 @@ "phpcompatibility/phpcompatibility-paragonie": "^1.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7" + "dealerdirect/phpcodesniffer-composer-installer": "^1.0" }, "suggest": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0 || This Composer plugin will sort out the PHP_CodeSniffer 'installed_paths' automatically.", "roave/security-advisories": "dev-master || Helps prevent installing dependencies with known security issues." }, "type": "phpcodesniffer-standard", @@ -3893,9 +3904,24 @@ ], "support": { "issues": "https://github.com/PHPCompatibility/PHPCompatibilityWP/issues", + "security": "https://github.com/PHPCompatibility/PHPCompatibilityWP/security/policy", "source": "https://github.com/PHPCompatibility/PHPCompatibilityWP" }, - "time": "2022-10-24T09:00:36+00:00" + "funding": [ + { + "url": "https://github.com/PHPCompatibility", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], + "time": "2024-04-24T21:37:59+00:00" }, { "name": "phpcsstandards/phpcsextra", @@ -3977,22 +4003,22 @@ }, { "name": "phpcsstandards/phpcsutils", - "version": "1.0.9", + "version": "1.0.12", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHPCSUtils.git", - "reference": "908247bc65010c7b7541a9551e002db12e9dae70" + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/908247bc65010c7b7541a9551e002db12e9dae70", - "reference": "908247bc65010c7b7541a9551e002db12e9dae70", + "url": "https://api.github.com/repos/PHPCSStandards/PHPCSUtils/zipball/87b233b00daf83fb70f40c9a28692be017ea7c6c", + "reference": "87b233b00daf83fb70f40c9a28692be017ea7c6c", "shasum": "" }, "require": { "dealerdirect/phpcodesniffer-composer-installer": "^0.4.1 || ^0.5 || ^0.6.2 || ^0.7 || ^1.0", "php": ">=5.4", - "squizlabs/php_codesniffer": "^3.8.0 || 4.0.x-dev@dev" + "squizlabs/php_codesniffer": "^3.10.0 || 4.0.x-dev@dev" }, "require-dev": { "ext-filter": "*", @@ -4061,7 +4087,7 @@ "type": "open_collective" } ], - "time": "2023-12-08T14:50:00+00:00" + "time": "2024-05-20T13:34:27+00:00" }, { "name": "phpunit/php-code-coverage", @@ -4362,42 +4388,42 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.37", + "version": "8.5.39", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fce30f306cee78be33ba00c8f9a853f41db0491b" + "reference": "172ba97bcf97ae6ef86ca256adf77aece8a143fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fce30f306cee78be33ba00c8f9a853f41db0491b", - "reference": "fce30f306cee78be33ba00c8f9a853f41db0491b", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/172ba97bcf97ae6ef86ca256adf77aece8a143fe", + "reference": "172ba97bcf97ae6ef86ca256adf77aece8a143fe", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.5.0", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.2", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", + "phpunit/php-code-coverage": "^7.0.17", + "phpunit/php-file-iterator": "^2.0.6", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", + "phpunit/php-timer": "^2.1.4", "sebastian/comparator": "^3.0.5", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.5", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", + "sebastian/diff": "^3.0.6", + "sebastian/environment": "^4.2.5", + "sebastian/exporter": "^3.1.6", + "sebastian/global-state": "^3.0.5", + "sebastian/object-enumerator": "^3.0.5", + "sebastian/resource-operations": "^2.0.3", + "sebastian/type": "^1.1.5", "sebastian/version": "^2.0.1" }, "suggest": { @@ -4440,7 +4466,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.37" + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.39" }, "funding": [ { @@ -4456,7 +4482,7 @@ "type": "tidelift" } ], - "time": "2024-03-06T06:27:42+00:00" + "time": "2024-07-10T11:43:00+00:00" }, { "name": "psr/container", @@ -4610,20 +4636,20 @@ }, { "name": "psr/http-factory", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-factory.git", - "reference": "e616d01114759c4c489f93b099585439f795fe35" + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-factory/zipball/e616d01114759c4c489f93b099585439f795fe35", - "reference": "e616d01114759c4c489f93b099585439f795fe35", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", "shasum": "" }, "require": { - "php": ">=7.0.0", + "php": ">=7.1", "psr/http-message": "^1.0 || ^2.0" }, "type": "library", @@ -4647,7 +4673,7 @@ "homepage": "https://www.php-fig.org/" } ], - "description": "Common interfaces for PSR-7 HTTP message factories", + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", "keywords": [ "factory", "http", @@ -4659,9 +4685,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-factory/tree/1.0.2" + "source": "https://github.com/php-fig/http-factory" }, - "time": "2023-04-10T20:10:41+00:00" + "time": "2024-04-15T12:06:14+00:00" }, { "name": "psr/http-message", @@ -5562,23 +5588,23 @@ }, { "name": "seld/jsonlint", - "version": "1.10.2", + "version": "1.11.0", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259" + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/9bb7db07b5d66d90f6ebf542f09fc67d800e5259", - "reference": "9bb7db07b5d66d90f6ebf542f09fc67d800e5259", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/1748aaf847fc731cfad7725aec413ee46f0cc3a2", + "reference": "1748aaf847fc731cfad7725aec413ee46f0cc3a2", "shasum": "" }, "require": { "php": "^5.3 || ^7.0 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^1.5", + "phpstan/phpstan": "^1.11", "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0 || ^8.5.13" }, "bin": [ @@ -5610,7 +5636,7 @@ ], "support": { "issues": "https://github.com/Seldaek/jsonlint/issues", - "source": "https://github.com/Seldaek/jsonlint/tree/1.10.2" + "source": "https://github.com/Seldaek/jsonlint/tree/1.11.0" }, "funding": [ { @@ -5622,7 +5648,7 @@ "type": "tidelift" } ], - "time": "2024-02-07T12:57:50+00:00" + "time": "2024-07-11T14:55:45+00:00" }, { "name": "seld/phar-utils", @@ -5674,16 +5700,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.8.0", + "version": "3.10.2", "source": { "type": "git", "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7" + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5805f7a4e4958dbb5e944ef1e6edae0a303765e7", - "reference": "5805f7a4e4958dbb5e944ef1e6edae0a303765e7", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/86e5f5dd9a840c46810ebe5ff1885581c42a3017", + "reference": "86e5f5dd9a840c46810ebe5ff1885581c42a3017", "shasum": "" }, "require": { @@ -5693,11 +5719,11 @@ "php": ">=5.4.0" }, "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.3.4" }, "bin": [ - "bin/phpcs", - "bin/phpcbf" + "bin/phpcbf", + "bin/phpcs" ], "type": "library", "extra": { @@ -5750,20 +5776,20 @@ "type": "open_collective" } ], - "time": "2023-12-08T12:32:31+00:00" + "time": "2024-07-21T23:26:44+00:00" }, { "name": "symfony/browser-kit", - "version": "v5.4.35", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "2f6f979b579ed1c051465c3c2fb81daf5bb4a002" + "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/2f6f979b579ed1c051465c3c2fb81daf5bb4a002", - "reference": "2f6f979b579ed1c051465c3c2fb81daf5bb4a002", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/92c8ba1e5ee12d07120744c90898516132b4e58b", + "reference": "92c8ba1e5ee12d07120744c90898516132b4e58b", "shasum": "" }, "require": { @@ -5806,7 +5832,7 @@ "description": "Simulates the behavior of a web browser, allowing you to make requests, click on links and submit forms programmatically", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/browser-kit/tree/v5.4.35" + "source": "https://github.com/symfony/browser-kit/tree/v5.4.40" }, "funding": [ { @@ -5822,20 +5848,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/console", - "version": "v5.4.36", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e" + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e", - "reference": "39f75d9d73d0c11952fdcecf4877b4d0f62a8f6e", + "url": "https://api.github.com/repos/symfony/console/zipball/e86f8554de667c16dde8aeb89a3990cfde924df9", + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9", "shasum": "" }, "require": { @@ -5905,7 +5931,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.36" + "source": "https://github.com/symfony/console/tree/v5.4.43" }, "funding": [ { @@ -5921,20 +5947,20 @@ "type": "tidelift" } ], - "time": "2024-02-20T16:33:57+00:00" + "time": "2024-08-13T16:31:56+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.35", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "9e615d367e2bed41f633abb383948c96a2dbbfae" + "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/9e615d367e2bed41f633abb383948c96a2dbbfae", - "reference": "9e615d367e2bed41f633abb383948c96a2dbbfae", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", + "reference": "ea43887e9afd2029509662d4f95e8b5ef6fc9bbb", "shasum": "" }, "require": { @@ -5971,7 +5997,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.35" + "source": "https://github.com/symfony/css-selector/tree/v5.4.40" }, "funding": [ { @@ -5987,7 +6013,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6058,16 +6084,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v5.4.35", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "e3b4806f88abf106a411847a78619a542e71de29" + "reference": "2ad469c3e07fdba677b278d0e266071a51aa0dac" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/e3b4806f88abf106a411847a78619a542e71de29", - "reference": "e3b4806f88abf106a411847a78619a542e71de29", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/2ad469c3e07fdba677b278d0e266071a51aa0dac", + "reference": "2ad469c3e07fdba677b278d0e266071a51aa0dac", "shasum": "" }, "require": { @@ -6113,7 +6139,7 @@ "description": "Eases DOM navigation for HTML and XML documents", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/dom-crawler/tree/v5.4.35" + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.40" }, "funding": [ { @@ -6129,20 +6155,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/event-dispatcher", - "version": "v5.4.35", + "version": "v5.4.40", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "7a69a85c7ea5bdd1e875806a99c51a87d3a74b38" + "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/7a69a85c7ea5bdd1e875806a99c51a87d3a74b38", - "reference": "7a69a85c7ea5bdd1e875806a99c51a87d3a74b38", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/a54e2a8a114065f31020d6a89ede83e34c3b27a4", + "reference": "a54e2a8a114065f31020d6a89ede83e34c3b27a4", "shasum": "" }, "require": { @@ -6198,7 +6224,7 @@ "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.35" + "source": "https://github.com/symfony/event-dispatcher/tree/v5.4.40" }, "funding": [ { @@ -6214,7 +6240,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-05-31T14:33:22+00:00" }, { "name": "symfony/event-dispatcher-contracts", @@ -6297,16 +6323,16 @@ }, { "name": "symfony/filesystem", - "version": "v5.4.35", + "version": "v5.4.41", "source": { "type": "git", "url": "https://github.com/symfony/filesystem.git", - "reference": "5a553607d4ffbfa9c0ab62facadea296c9db7086" + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/filesystem/zipball/5a553607d4ffbfa9c0ab62facadea296c9db7086", - "reference": "5a553607d4ffbfa9c0ab62facadea296c9db7086", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/6d29dd9340b372fa603f04e6df4dd76bb808591e", + "reference": "6d29dd9340b372fa603f04e6df4dd76bb808591e", "shasum": "" }, "require": { @@ -6315,6 +6341,9 @@ "symfony/polyfill-mbstring": "~1.8", "symfony/polyfill-php80": "^1.16" }, + "require-dev": { + "symfony/process": "^5.4|^6.4" + }, "type": "library", "autoload": { "psr-4": { @@ -6341,7 +6370,7 @@ "description": "Provides basic utilities for the filesystem", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/filesystem/tree/v5.4.35" + "source": "https://github.com/symfony/filesystem/tree/v5.4.41" }, "funding": [ { @@ -6357,20 +6386,20 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-06-28T09:36:24+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ef4d7e442ca910c4764bce785146269b30cb5fc4", - "reference": "ef4d7e442ca910c4764bce785146269b30cb5fc4", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -6420,7 +6449,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -6436,20 +6465,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/32a9da87d7b3245e09ac426c83d334ae9f06f80f", - "reference": "32a9da87d7b3245e09ac426c83d334ae9f06f80f", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -6498,7 +6527,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -6514,20 +6543,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/bc45c394692b948b4d383a08d7753968bed9a83d", - "reference": "bc45c394692b948b4d383a08d7753968bed9a83d", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -6579,7 +6608,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -6595,20 +6624,20 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.29.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2" + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/21bd091060673a1177ae842c0ef8fe30893114d2", - "reference": "21bd091060673a1177ae842c0ef8fe30893114d2", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", "shasum": "" }, "require": { @@ -6655,7 +6684,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.29.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" }, "funding": [ { @@ -6671,7 +6700,7 @@ "type": "tidelift" } ], - "time": "2024-01-29T20:11:03+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php80", @@ -6900,16 +6929,16 @@ }, { "name": "symfony/string", - "version": "v5.4.36", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b" + "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/4e232c83622bd8cd32b794216aa29d0d266d353b", - "reference": "4e232c83622bd8cd32b794216aa29d0d266d353b", + "url": "https://api.github.com/repos/symfony/string/zipball/8be1d484951ff5ca995eaf8edcbcb8b9a5888450", + "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450", "shasum": "" }, "require": { @@ -6966,7 +6995,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.36" + "source": "https://github.com/symfony/string/tree/v5.4.43" }, "funding": [ { @@ -6982,20 +7011,20 @@ "type": "tidelift" } ], - "time": "2024-02-01T08:49:30+00:00" + "time": "2024-08-01T10:24:28+00:00" }, { "name": "symfony/yaml", - "version": "v5.4.35", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "e78db7f5c70a21f0417a31f414c4a95fe76c07e4" + "reference": "62f96e1cfd4cf518882a36bfedcf1fe4093c1299" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/e78db7f5c70a21f0417a31f414c4a95fe76c07e4", - "reference": "e78db7f5c70a21f0417a31f414c4a95fe76c07e4", + "url": "https://api.github.com/repos/symfony/yaml/zipball/62f96e1cfd4cf518882a36bfedcf1fe4093c1299", + "reference": "62f96e1cfd4cf518882a36bfedcf1fe4093c1299", "shasum": "" }, "require": { @@ -7041,7 +7070,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v5.4.35" + "source": "https://github.com/symfony/yaml/tree/v5.4.43" }, "funding": [ { @@ -7057,7 +7086,7 @@ "type": "tidelift" } ], - "time": "2024-01-23T13:51:25+00:00" + "time": "2024-08-11T17:40:32+00:00" }, { "name": "theseer/tokenizer", @@ -7164,16 +7193,16 @@ }, { "name": "wp-cli/cache-command", - "version": "v2.1.2", + "version": "v2.1.3", "source": { "type": "git", "url": "https://github.com/wp-cli/cache-command.git", - "reference": "205c004ce6127c605e4a71840a6f0b5be72b0517" + "reference": "1dbb59e5ed126b9a2fa9d521d29910f3f4eb0f97" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/205c004ce6127c605e4a71840a6f0b5be72b0517", - "reference": "205c004ce6127c605e4a71840a6f0b5be72b0517", + "url": "https://api.github.com/repos/wp-cli/cache-command/zipball/1dbb59e5ed126b9a2fa9d521d29910f3f4eb0f97", + "reference": "1dbb59e5ed126b9a2fa9d521d29910f3f4eb0f97", "shasum": "" }, "require": { @@ -7233,9 +7262,9 @@ "homepage": "https://github.com/wp-cli/cache-command", "support": { "issues": "https://github.com/wp-cli/cache-command/issues", - "source": "https://github.com/wp-cli/cache-command/tree/v2.1.2" + "source": "https://github.com/wp-cli/cache-command/tree/v2.1.3" }, - "time": "2024-01-11T14:00:20+00:00" + "time": "2024-04-26T14:54:22+00:00" }, { "name": "wp-cli/checksum-command", @@ -7298,16 +7327,16 @@ }, { "name": "wp-cli/config-command", - "version": "v2.3.3", + "version": "v2.3.6", "source": { "type": "git", "url": "https://github.com/wp-cli/config-command.git", - "reference": "890b6e3c8fd945dcad2bff4bf565ba6dfb33e35d" + "reference": "82a64ae0dbd8bc91e2bf0446666ae24650223775" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/config-command/zipball/890b6e3c8fd945dcad2bff4bf565ba6dfb33e35d", - "reference": "890b6e3c8fd945dcad2bff4bf565ba6dfb33e35d", + "url": "https://api.github.com/repos/wp-cli/config-command/zipball/82a64ae0dbd8bc91e2bf0446666ae24650223775", + "reference": "82a64ae0dbd8bc91e2bf0446666ae24650223775", "shasum": "" }, "require": { @@ -7366,22 +7395,22 @@ "homepage": "https://github.com/wp-cli/config-command", "support": { "issues": "https://github.com/wp-cli/config-command/issues", - "source": "https://github.com/wp-cli/config-command/tree/v2.3.3" + "source": "https://github.com/wp-cli/config-command/tree/v2.3.6" }, - "time": "2023-12-21T10:01:16+00:00" + "time": "2024-08-05T13:34:06+00:00" }, { "name": "wp-cli/core-command", - "version": "v2.1.17", + "version": "v2.1.18", "source": { "type": "git", "url": "https://github.com/wp-cli/core-command.git", - "reference": "dcac4c36a3c596f1c81779bdbaa0c5f508f14075" + "reference": "f7580f93fe66a5584fa7b7c42bd2c0c1435c9d2e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/core-command/zipball/dcac4c36a3c596f1c81779bdbaa0c5f508f14075", - "reference": "dcac4c36a3c596f1c81779bdbaa0c5f508f14075", + "url": "https://api.github.com/repos/wp-cli/core-command/zipball/f7580f93fe66a5584fa7b7c42bd2c0c1435c9d2e", + "reference": "f7580f93fe66a5584fa7b7c42bd2c0c1435c9d2e", "shasum": "" }, "require": { @@ -7437,22 +7466,22 @@ "homepage": "https://github.com/wp-cli/core-command", "support": { "issues": "https://github.com/wp-cli/core-command/issues", - "source": "https://github.com/wp-cli/core-command/tree/v2.1.17" + "source": "https://github.com/wp-cli/core-command/tree/v2.1.18" }, - "time": "2024-01-11T11:03:57+00:00" + "time": "2024-04-12T09:36:36+00:00" }, { "name": "wp-cli/cron-command", - "version": "v2.2.3", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/wp-cli/cron-command.git", - "reference": "bc7e4bd2f441a5bb3b311e1419be2b05ed53146d" + "reference": "2108295a2f30de77d3ee70b1a60d1b542c2dfd79" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/cron-command/zipball/bc7e4bd2f441a5bb3b311e1419be2b05ed53146d", - "reference": "bc7e4bd2f441a5bb3b311e1419be2b05ed53146d", + "url": "https://api.github.com/repos/wp-cli/cron-command/zipball/2108295a2f30de77d3ee70b1a60d1b542c2dfd79", + "reference": "2108295a2f30de77d3ee70b1a60d1b542c2dfd79", "shasum": "" }, "require": { @@ -7506,22 +7535,22 @@ "homepage": "https://github.com/wp-cli/cron-command", "support": { "issues": "https://github.com/wp-cli/cron-command/issues", - "source": "https://github.com/wp-cli/cron-command/tree/v2.2.3" + "source": "https://github.com/wp-cli/cron-command/tree/v2.3.0" }, - "time": "2023-08-30T13:31:32+00:00" + "time": "2024-02-15T10:23:39+00:00" }, { "name": "wp-cli/db-command", - "version": "v2.0.27", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/wp-cli/db-command.git", - "reference": "eea28dd115fb381c82641a2a3060856d3a67242d" + "reference": "60ee5535e4b39e2d930894b7f435a2e488171c27" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/db-command/zipball/eea28dd115fb381c82641a2a3060856d3a67242d", - "reference": "eea28dd115fb381c82641a2a3060856d3a67242d", + "url": "https://api.github.com/repos/wp-cli/db-command/zipball/60ee5535e4b39e2d930894b7f435a2e488171c27", + "reference": "60ee5535e4b39e2d930894b7f435a2e488171c27", "shasum": "" }, "require": { @@ -7580,22 +7609,22 @@ "homepage": "https://github.com/wp-cli/db-command", "support": { "issues": "https://github.com/wp-cli/db-command/issues", - "source": "https://github.com/wp-cli/db-command/tree/v2.0.27" + "source": "https://github.com/wp-cli/db-command/tree/v2.1.1" }, - "time": "2023-11-13T12:34:44+00:00" + "time": "2024-07-10T17:31:56+00:00" }, { "name": "wp-cli/embed-command", - "version": "v2.0.15", + "version": "v2.0.16", "source": { "type": "git", "url": "https://github.com/wp-cli/embed-command.git", - "reference": "3987e2051354eaad842c8612ea9255493534c589" + "reference": "edfa448396484770a419ac7a17b0ec194ae76654" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/embed-command/zipball/3987e2051354eaad842c8612ea9255493534c589", - "reference": "3987e2051354eaad842c8612ea9255493534c589", + "url": "https://api.github.com/repos/wp-cli/embed-command/zipball/edfa448396484770a419ac7a17b0ec194ae76654", + "reference": "edfa448396484770a419ac7a17b0ec194ae76654", "shasum": "" }, "require": { @@ -7647,26 +7676,26 @@ "homepage": "https://github.com/wp-cli/embed-command", "support": { "issues": "https://github.com/wp-cli/embed-command/issues", - "source": "https://github.com/wp-cli/embed-command/tree/v2.0.15" + "source": "https://github.com/wp-cli/embed-command/tree/v2.0.16" }, - "time": "2023-08-30T15:52:06+00:00" + "time": "2024-04-04T11:57:03+00:00" }, { "name": "wp-cli/entity-command", - "version": "v2.6.2", + "version": "v2.8.1", "source": { "type": "git", "url": "https://github.com/wp-cli/entity-command.git", - "reference": "2b5d5d54550edb7383ebaa77fb3a2d53871ba19a" + "reference": "c270cc9a2367cb8f5845f26a6b5e203397c91392" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/entity-command/zipball/2b5d5d54550edb7383ebaa77fb3a2d53871ba19a", - "reference": "2b5d5d54550edb7383ebaa77fb3a2d53871ba19a", + "url": "https://api.github.com/repos/wp-cli/entity-command/zipball/c270cc9a2367cb8f5845f26a6b5e203397c91392", + "reference": "c270cc9a2367cb8f5845f26a6b5e203397c91392", "shasum": "" }, "require": { - "wp-cli/wp-cli": "^2.10" + "wp-cli/wp-cli": "^2.11" }, "require-dev": { "wp-cli/cache-command": "^1 || ^2", @@ -7772,11 +7801,20 @@ "site activate", "site archive", "site create", + "site generate", "site deactivate", "site delete", "site empty", "site list", "site mature", + "site meta", + "site meta add", + "site meta delete", + "site meta get", + "site meta list", + "site meta patch", + "site meta pluck", + "site meta update", "site option", "site private", "site public", @@ -7806,8 +7844,17 @@ "user", "user add-cap", "user add-role", + "user application-password", + "user application-password create", + "user application-password delete", + "user application-password exists", + "user application-password get", + "user application-password list", + "user application-password record-usage", + "user application-password update", "user create", "user delete", + "user exists", "user generate", "user get", "user import-csv", @@ -7828,6 +7875,11 @@ "user session destroy", "user session list", "user set-role", + "user signup", + "user signup activate", + "user signup delete", + "user signup get", + "user signup list", "user spam", "user term", "user term add", @@ -7861,9 +7913,9 @@ "homepage": "https://github.com/wp-cli/entity-command", "support": { "issues": "https://github.com/wp-cli/entity-command/issues", - "source": "https://github.com/wp-cli/entity-command/tree/v2.6.2" + "source": "https://github.com/wp-cli/entity-command/tree/v2.8.1" }, - "time": "2024-02-06T13:38:03+00:00" + "time": "2024-07-29T13:52:21+00:00" }, { "name": "wp-cli/eval-command", @@ -7988,16 +8040,16 @@ }, { "name": "wp-cli/extension-command", - "version": "v2.1.19", + "version": "v2.1.22", "source": { "type": "git", "url": "https://github.com/wp-cli/extension-command.git", - "reference": "80713703e090fbc74926af6f75bf963619f76fdb" + "reference": "7baa058ae33e78a8e19f6a189203ed08e03a21be" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/80713703e090fbc74926af6f75bf963619f76fdb", - "reference": "80713703e090fbc74926af6f75bf963619f76fdb", + "url": "https://api.github.com/repos/wp-cli/extension-command/zipball/7baa058ae33e78a8e19f6a189203ed08e03a21be", + "reference": "7baa058ae33e78a8e19f6a189203ed08e03a21be", "shasum": "" }, "require": { @@ -8080,22 +8132,22 @@ "homepage": "https://github.com/wp-cli/extension-command", "support": { "issues": "https://github.com/wp-cli/extension-command/issues", - "source": "https://github.com/wp-cli/extension-command/tree/v2.1.19" + "source": "https://github.com/wp-cli/extension-command/tree/v2.1.22" }, - "time": "2024-02-05T14:53:09+00:00" + "time": "2024-06-04T12:24:31+00:00" }, { "name": "wp-cli/i18n-command", - "version": "2.6.1", + "version": "v2.6.2", "source": { "type": "git", "url": "https://github.com/wp-cli/i18n-command.git", - "reference": "7538d684d4f06b0e10c8a0166ce4e6d9e1687aa1" + "reference": "53518a11f314119e320597c7a8274f11b1295bdc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/7538d684d4f06b0e10c8a0166ce4e6d9e1687aa1", - "reference": "7538d684d4f06b0e10c8a0166ce4e6d9e1687aa1", + "url": "https://api.github.com/repos/wp-cli/i18n-command/zipball/53518a11f314119e320597c7a8274f11b1295bdc", + "reference": "53518a11f314119e320597c7a8274f11b1295bdc", "shasum": "" }, "require": { @@ -8149,9 +8201,9 @@ "homepage": "https://github.com/wp-cli/i18n-command", "support": { "issues": "https://github.com/wp-cli/i18n-command/issues", - "source": "https://github.com/wp-cli/i18n-command/tree/2.6.1" + "source": "https://github.com/wp-cli/i18n-command/tree/v2.6.2" }, - "time": "2024-02-28T11:27:34+00:00" + "time": "2024-07-03T12:50:00+00:00" }, { "name": "wp-cli/import-command", @@ -8215,16 +8267,16 @@ }, { "name": "wp-cli/language-command", - "version": "v2.0.19", + "version": "v2.0.21", "source": { "type": "git", "url": "https://github.com/wp-cli/language-command.git", - "reference": "4d0a2e58f8c48772e0a85a3b25f413ef240c212a" + "reference": "a9b5ae5976ebb48ee5465cf2f8d9afc863bc4e1c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/language-command/zipball/4d0a2e58f8c48772e0a85a3b25f413ef240c212a", - "reference": "4d0a2e58f8c48772e0a85a3b25f413ef240c212a", + "url": "https://api.github.com/repos/wp-cli/language-command/zipball/a9b5ae5976ebb48ee5465cf2f8d9afc863bc4e1c", + "reference": "a9b5ae5976ebb48ee5465cf2f8d9afc863bc4e1c", "shasum": "" }, "require": { @@ -8288,22 +8340,22 @@ "homepage": "https://github.com/wp-cli/language-command", "support": { "issues": "https://github.com/wp-cli/language-command/issues", - "source": "https://github.com/wp-cli/language-command/tree/v2.0.19" + "source": "https://github.com/wp-cli/language-command/tree/v2.0.21" }, - "time": "2024-02-01T14:28:11+00:00" + "time": "2024-06-21T10:12:40+00:00" }, { "name": "wp-cli/maintenance-mode-command", - "version": "v2.1.0", + "version": "v2.1.1", "source": { "type": "git", "url": "https://github.com/wp-cli/maintenance-mode-command.git", - "reference": "2e9845a1cd1678b960dd8d0dd0c936648113788c" + "reference": "a329a536eb96890654b913b5499b300fcc3f8eab" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/maintenance-mode-command/zipball/2e9845a1cd1678b960dd8d0dd0c936648113788c", - "reference": "2e9845a1cd1678b960dd8d0dd0c936648113788c", + "url": "https://api.github.com/repos/wp-cli/maintenance-mode-command/zipball/a329a536eb96890654b913b5499b300fcc3f8eab", + "reference": "a329a536eb96890654b913b5499b300fcc3f8eab", "shasum": "" }, "require": { @@ -8349,22 +8401,22 @@ "homepage": "https://github.com/wp-cli/maintenance-mode-command", "support": { "issues": "https://github.com/wp-cli/maintenance-mode-command/issues", - "source": "https://github.com/wp-cli/maintenance-mode-command/tree/v2.1.0" + "source": "https://github.com/wp-cli/maintenance-mode-command/tree/v2.1.1" }, - "time": "2023-11-06T14:04:13+00:00" + "time": "2024-04-04T11:28:11+00:00" }, { "name": "wp-cli/media-command", - "version": "v2.0.21", + "version": "v2.2.0", "source": { "type": "git", "url": "https://github.com/wp-cli/media-command.git", - "reference": "4950ed4ded35c52068d30fec080d545a33baa85c" + "reference": "8eefc101713713871c1802e387b87348f6a048d5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/media-command/zipball/4950ed4ded35c52068d30fec080d545a33baa85c", - "reference": "4950ed4ded35c52068d30fec080d545a33baa85c", + "url": "https://api.github.com/repos/wp-cli/media-command/zipball/8eefc101713713871c1802e387b87348f6a048d5", + "reference": "8eefc101713713871c1802e387b87348f6a048d5", "shasum": "" }, "require": { @@ -8411,9 +8463,9 @@ "homepage": "https://github.com/wp-cli/media-command", "support": { "issues": "https://github.com/wp-cli/media-command/issues", - "source": "https://github.com/wp-cli/media-command/tree/v2.0.21" + "source": "https://github.com/wp-cli/media-command/tree/v2.2.0" }, - "time": "2023-11-10T21:56:52+00:00" + "time": "2024-06-06T09:32:12+00:00" }, { "name": "wp-cli/mustangostang-spyc", @@ -8468,16 +8520,16 @@ }, { "name": "wp-cli/package-command", - "version": "v2.5.0", + "version": "v2.5.2", "source": { "type": "git", "url": "https://github.com/wp-cli/package-command.git", - "reference": "71683195f8c27ad97009628e2a72d2a4155503b2" + "reference": "3370dd88ddf906992bda3a28c8c387c8f4f33073" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/package-command/zipball/71683195f8c27ad97009628e2a72d2a4155503b2", - "reference": "71683195f8c27ad97009628e2a72d2a4155503b2", + "url": "https://api.github.com/repos/wp-cli/package-command/zipball/3370dd88ddf906992bda3a28c8c387c8f4f33073", + "reference": "3370dd88ddf906992bda3a28c8c387c8f4f33073", "shasum": "" }, "require": { @@ -8527,9 +8579,9 @@ "homepage": "https://github.com/wp-cli/package-command", "support": { "issues": "https://github.com/wp-cli/package-command/issues", - "source": "https://github.com/wp-cli/package-command/tree/v2.5.0" + "source": "https://github.com/wp-cli/package-command/tree/v2.5.2" }, - "time": "2023-12-08T10:38:16+00:00" + "time": "2024-05-22T05:26:05+00:00" }, { "name": "wp-cli/php-cli-tools", @@ -8723,16 +8775,16 @@ }, { "name": "wp-cli/scaffold-command", - "version": "v2.2.0", + "version": "v2.3.0", "source": { "type": "git", "url": "https://github.com/wp-cli/scaffold-command.git", - "reference": "8aa906c3ec6ae7d95f38c962fc2561714f9c7145" + "reference": "7a7d145c260ead64fa93a59498d60def970d5214" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/scaffold-command/zipball/8aa906c3ec6ae7d95f38c962fc2561714f9c7145", - "reference": "8aa906c3ec6ae7d95f38c962fc2561714f9c7145", + "url": "https://api.github.com/repos/wp-cli/scaffold-command/zipball/7a7d145c260ead64fa93a59498d60def970d5214", + "reference": "7a7d145c260ead64fa93a59498d60def970d5214", "shasum": "" }, "require": { @@ -8783,22 +8835,22 @@ "homepage": "https://github.com/wp-cli/scaffold-command", "support": { "issues": "https://github.com/wp-cli/scaffold-command/issues", - "source": "https://github.com/wp-cli/scaffold-command/tree/v2.2.0" + "source": "https://github.com/wp-cli/scaffold-command/tree/v2.3.0" }, - "time": "2023-11-16T15:25:33+00:00" + "time": "2024-04-26T21:05:48+00:00" }, { "name": "wp-cli/search-replace-command", - "version": "v2.1.5", + "version": "v2.1.7", "source": { "type": "git", "url": "https://github.com/wp-cli/search-replace-command.git", - "reference": "f6c828abc6d5054d5bbf202b917d2a3b38abed84" + "reference": "89e1653c9b888179a121a8354c75fc5e8ca7931d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/search-replace-command/zipball/f6c828abc6d5054d5bbf202b917d2a3b38abed84", - "reference": "f6c828abc6d5054d5bbf202b917d2a3b38abed84", + "url": "https://api.github.com/repos/wp-cli/search-replace-command/zipball/89e1653c9b888179a121a8354c75fc5e8ca7931d", + "reference": "89e1653c9b888179a121a8354c75fc5e8ca7931d", "shasum": "" }, "require": { @@ -8843,9 +8895,9 @@ "homepage": "https://github.com/wp-cli/search-replace-command", "support": { "issues": "https://github.com/wp-cli/search-replace-command/issues", - "source": "https://github.com/wp-cli/search-replace-command/tree/v2.1.5" + "source": "https://github.com/wp-cli/search-replace-command/tree/v2.1.7" }, - "time": "2024-01-09T00:29:39+00:00" + "time": "2024-06-28T09:30:38+00:00" }, { "name": "wp-cli/server-command", @@ -8964,16 +9016,16 @@ }, { "name": "wp-cli/super-admin-command", - "version": "v2.0.13", + "version": "v2.0.14", "source": { "type": "git", "url": "https://github.com/wp-cli/super-admin-command.git", - "reference": "9d91c131ad814f9bcec313c3877e8348622720d5" + "reference": "0fc8a6146d0450a8b522485e50886e976f5249b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/super-admin-command/zipball/9d91c131ad814f9bcec313c3877e8348622720d5", - "reference": "9d91c131ad814f9bcec313c3877e8348622720d5", + "url": "https://api.github.com/repos/wp-cli/super-admin-command/zipball/0fc8a6146d0450a8b522485e50886e976f5249b6", + "reference": "0fc8a6146d0450a8b522485e50886e976f5249b6", "shasum": "" }, "require": { @@ -9019,22 +9071,22 @@ "homepage": "https://github.com/wp-cli/super-admin-command", "support": { "issues": "https://github.com/wp-cli/super-admin-command/issues", - "source": "https://github.com/wp-cli/super-admin-command/tree/v2.0.13" + "source": "https://github.com/wp-cli/super-admin-command/tree/v2.0.14" }, - "time": "2024-01-08T12:21:39+00:00" + "time": "2024-02-26T12:17:45+00:00" }, { "name": "wp-cli/widget-command", - "version": "v2.1.9", + "version": "v2.1.10", "source": { "type": "git", "url": "https://github.com/wp-cli/widget-command.git", - "reference": "fa67eb62b3b0248014f48fb1280bfdea2eb96712" + "reference": "7062ed3fdfa17265320737f43efe5651d783f439" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/widget-command/zipball/fa67eb62b3b0248014f48fb1280bfdea2eb96712", - "reference": "fa67eb62b3b0248014f48fb1280bfdea2eb96712", + "url": "https://api.github.com/repos/wp-cli/widget-command/zipball/7062ed3fdfa17265320737f43efe5651d783f439", + "reference": "7062ed3fdfa17265320737f43efe5651d783f439", "shasum": "" }, "require": { @@ -9086,22 +9138,22 @@ "homepage": "https://github.com/wp-cli/widget-command", "support": { "issues": "https://github.com/wp-cli/widget-command/issues", - "source": "https://github.com/wp-cli/widget-command/tree/v2.1.9" + "source": "https://github.com/wp-cli/widget-command/tree/v2.1.10" }, - "time": "2023-08-30T15:52:58+00:00" + "time": "2024-04-19T13:21:01+00:00" }, { "name": "wp-cli/wp-cli", - "version": "v2.10.0", + "version": "v2.11.0", "source": { "type": "git", "url": "https://github.com/wp-cli/wp-cli.git", - "reference": "a339dca576df73c31af4b4d8054efc2dab9a0685" + "reference": "53f0df112901fcf95099d0f501912a209429b6a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/a339dca576df73c31af4b4d8054efc2dab9a0685", - "reference": "a339dca576df73c31af4b4d8054efc2dab9a0685", + "url": "https://api.github.com/repos/wp-cli/wp-cli/zipball/53f0df112901fcf95099d0f501912a209429b6a9", + "reference": "53f0df112901fcf95099d0f501912a209429b6a9", "shasum": "" }, "require": { @@ -9131,7 +9183,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.10.x-dev" + "dev-main": "2.11.x-dev" } }, "autoload": { @@ -9158,20 +9210,20 @@ "issues": "https://github.com/wp-cli/wp-cli/issues", "source": "https://github.com/wp-cli/wp-cli" }, - "time": "2024-02-08T16:52:43+00:00" + "time": "2024-08-08T03:04:55+00:00" }, { "name": "wp-cli/wp-cli-bundle", - "version": "v2.10.0", + "version": "v2.11.0", "source": { "type": "git", "url": "https://github.com/wp-cli/wp-cli-bundle.git", - "reference": "b795ca19f12bf9605dc8d85235d55a721b43064c" + "reference": "f77a284ccf92023981046edf63111ab427106d05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-cli-bundle/zipball/b795ca19f12bf9605dc8d85235d55a721b43064c", - "reference": "b795ca19f12bf9605dc8d85235d55a721b43064c", + "url": "https://api.github.com/repos/wp-cli/wp-cli-bundle/zipball/f77a284ccf92023981046edf63111ab427106d05", + "reference": "f77a284ccf92023981046edf63111ab427106d05", "shasum": "" }, "require": { @@ -9201,7 +9253,7 @@ "wp-cli/shell-command": "^2", "wp-cli/super-admin-command": "^2", "wp-cli/widget-command": "^2", - "wp-cli/wp-cli": "^2.10.0" + "wp-cli/wp-cli": "^2.11.0" }, "require-dev": { "roave/security-advisories": "dev-latest", @@ -9213,7 +9265,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-main": "2.9.x-dev" + "dev-main": "2.11.x-dev" } }, "notification-url": "https://packagist.org/downloads/", @@ -9231,20 +9283,20 @@ "issues": "https://github.com/wp-cli/wp-cli-bundle/issues", "source": "https://github.com/wp-cli/wp-cli-bundle" }, - "time": "2024-02-08T17:05:33+00:00" + "time": "2024-08-08T03:29:34+00:00" }, { "name": "wp-cli/wp-config-transformer", - "version": "v1.3.5", + "version": "v1.3.6", "source": { "type": "git", "url": "https://github.com/wp-cli/wp-config-transformer.git", - "reference": "202aa80528939159d52bc4026cee5453aec382db" + "reference": "88f516f44dce1660fc4b780da513e3ca12d7d24f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/wp-cli/wp-config-transformer/zipball/202aa80528939159d52bc4026cee5453aec382db", - "reference": "202aa80528939159d52bc4026cee5453aec382db", + "url": "https://api.github.com/repos/wp-cli/wp-config-transformer/zipball/88f516f44dce1660fc4b780da513e3ca12d7d24f", + "reference": "88f516f44dce1660fc4b780da513e3ca12d7d24f", "shasum": "" }, "require": { @@ -9273,22 +9325,22 @@ "homepage": "https://github.com/wp-cli/wp-config-transformer", "support": { "issues": "https://github.com/wp-cli/wp-config-transformer/issues", - "source": "https://github.com/wp-cli/wp-config-transformer/tree/v1.3.5" + "source": "https://github.com/wp-cli/wp-config-transformer/tree/v1.3.6" }, - "time": "2023-11-10T14:28:03+00:00" + "time": "2024-05-23T06:32:14+00:00" }, { "name": "wp-coding-standards/wpcs", - "version": "3.0.1", + "version": "3.1.0", "source": { "type": "git", "url": "https://github.com/WordPress/WordPress-Coding-Standards.git", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1" + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/b4caf9689f1a0e4a4c632679a44e638c1c67aff1", - "reference": "b4caf9689f1a0e4a4c632679a44e638c1c67aff1", + "url": "https://api.github.com/repos/WordPress/WordPress-Coding-Standards/zipball/9333efcbff231f10dfd9c56bb7b65818b4733ca7", + "reference": "9333efcbff231f10dfd9c56bb7b65818b4733ca7", "shasum": "" }, "require": { @@ -9297,16 +9349,16 @@ "ext-tokenizer": "*", "ext-xmlreader": "*", "php": ">=5.4", - "phpcsstandards/phpcsextra": "^1.1.0", - "phpcsstandards/phpcsutils": "^1.0.8", - "squizlabs/php_codesniffer": "^3.7.2" + "phpcsstandards/phpcsextra": "^1.2.1", + "phpcsstandards/phpcsutils": "^1.0.10", + "squizlabs/php_codesniffer": "^3.9.0" }, "require-dev": { "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.0", "phpcsstandards/phpcsdevtools": "^1.2.0", - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" + "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "suggest": { "ext-iconv": "For improved results", @@ -9337,24 +9389,24 @@ }, "funding": [ { - "url": "https://opencollective.com/thewpcc/contribute/wp-php-63406", + "url": "https://opencollective.com/php_codesniffer", "type": "custom" } ], - "time": "2023-09-14T07:06:09+00:00" + "time": "2024-03-25T16:39:00+00:00" }, { "name": "yoast/phpunit-polyfills", - "version": "1.1.0", + "version": "1.1.1", "source": { "type": "git", "url": "https://github.com/Yoast/PHPUnit-Polyfills.git", - "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212" + "reference": "a0f7d708794a738f328d7b6c94380fd1d6c40446" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/224e4a1329c03d8bad520e3fc4ec980034a4b212", - "reference": "224e4a1329c03d8bad520e3fc4ec980034a4b212", + "url": "https://api.github.com/repos/Yoast/PHPUnit-Polyfills/zipball/a0f7d708794a738f328d7b6c94380fd1d6c40446", + "reference": "a0f7d708794a738f328d7b6c94380fd1d6c40446", "shasum": "" }, "require": { @@ -9362,7 +9414,9 @@ "phpunit/phpunit": "^4.8.36 || ^5.7.21 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "require-dev": { - "yoast/yoastcs": "^2.3.0" + "php-parallel-lint/php-console-highlighter": "^1.0.0", + "php-parallel-lint/php-parallel-lint": "^1.4.0", + "yoast/yoastcs": "^3.1.0" }, "type": "library", "extra": { @@ -9399,9 +9453,10 @@ ], "support": { "issues": "https://github.com/Yoast/PHPUnit-Polyfills/issues", + "security": "https://github.com/Yoast/PHPUnit-Polyfills/security/policy", "source": "https://github.com/Yoast/PHPUnit-Polyfills" }, - "time": "2023-08-19T14:25:08+00:00" + "time": "2024-04-05T16:01:51+00:00" }, { "name": "zordius/lightncandy", diff --git a/includes/extensions/edit-entry/partials/inline-javascript.php b/includes/extensions/edit-entry/partials/inline-javascript.php index 8579286f51..e9754e3b16 100644 --- a/includes/extensions/edit-entry/partials/inline-javascript.php +++ b/includes/extensions/edit-entry/partials/inline-javascript.php @@ -8,6 +8,8 @@ function DeleteFile(leadId, fieldId, deleteButton){ if(confirm('')){ var fileIndex = jQuery(deleteButton).parent().index(); + var preview_div = jQuery(deleteButton).parents('.gfield--type-fileupload'); + preview_div.find('button.gform_button_select_files').prop("disabled", false); var mysack = new sack(""); mysack.execute = 1; mysack.method = 'POST'; From 7fb5bbeb0f45dc24d99030b986d512d499c8aff9 Mon Sep 17 00:00:00 2001 From: omarkasem Date: Sun, 8 Sep 2024 08:35:18 +0300 Subject: [PATCH 02/37] Fix upload issue and Add disable button and message when max files is reached --- assets/js/fe-views.js | 73 +++++++++++++++++++++++++++++++++---------- 1 file changed, 56 insertions(+), 17 deletions(-) diff --git a/assets/js/fe-views.js b/assets/js/fe-views.js index d30cc1bc3c..903a12b553 100644 --- a/assets/js/fe-views.js +++ b/assets/js/fe-views.js @@ -32,34 +32,73 @@ jQuery( function ( $ ) { $( 'a.gv-sort' ).on( 'click', this.multiclick_sort ); - // this.multi_file_upload(); + this.disable_upload_file_when_limit_reached(); + + this.fix_updating_files_after_edit(); this.number_range(); }, - multi_file_upload: function(){ - if (typeof gfMultiFileUploader === 'undefined' || !gfMultiFileUploader || !gfMultiFileUploader.uploaders || gfMultiFileUploader.uploaders.length === 0) { - return; - } + /** + * Fix the issue of updating files after edit where the previous value still exists in the uploaded field. + */ + fix_updating_files_after_edit: function(){ + $.each($('.ginput_preview_list'), function(index, element){ + if ($(element).children().length > 0) { + return true; + } + + $(element).parents('form').find('[name=gform_uploaded_files]').val(''); + }); + }, + + /** + * Fix the issue for file upload fields where the button is not disabled and show message for multi upload file. + */ + disable_upload_file_when_limit_reached: function(){ var checkUploaders = setInterval(function() { - if (gfMultiFileUploader.uploaders && Object.keys(gfMultiFileUploader.uploaders).length > 0) { + if (typeof gfMultiFileUploader !== 'undefined' && gfMultiFileUploader.uploaders) { + clearInterval(checkUploaders); $.each(gfMultiFileUploader.uploaders, function(index, uploader){ - uploader.bind( 'Init', function( up, params ) { - var limit = parseInt(uploader.settings.gf_vars.max_files, 10); - if (limit <= 0) { - return; + uploader.bind('Init', function(up, params) { + var data = up.settings; + var max = data.gf_vars.max_files; + var fieldId = data.multipart_params.field_id; + var existingFilesCount = $('#preview_existing_files_'+fieldId).children().length; + var limitReached = existingFilesCount >= max; + gfMultiFileUploader.toggleDisabled(data, limitReached); + }); + + uploader.bind('FilesAdded', function(up, params) { + var data = up.settings; + var max = data.gf_vars.max_files; + var fieldId = data.multipart_params.field_id; + var formId = data.multipart_params.form_id; + var newFilesCount = $('#gform_preview_'+formId+'_'+fieldId).children().length; + var existingFilesCount = $('#preview_existing_files_'+fieldId).children().length; + var limitReached = existingFilesCount + newFilesCount >= max; + gfMultiFileUploader.toggleDisabled(data, limitReached); + + // Only show message if max is greater than 1 + if(max <= 1){ + return true; } - - var fieldId = uploader.settings.multipart_params.field_id; - var totalCount = $('#preview_existing_files_'+fieldId).children().length; - var limitReached = totalCount >= limit; - gfMultiFileUploader.toggleDisabled(uploader.settings, limitReached); + + $( "#" + up.settings.gf_vars.message_id ).prepend( "
  • " + + $('
    ').text(gform_gravityforms.strings.max_reached).html() + + + "
  • " ); + // Announce errors. + setTimeout(function () { + wp.a11y.speak( $( "#" + up.settings.gf_vars.message_id ).text() ); + }, 1000 ); + }); + }); - clearInterval(checkUploaders); } - }, 100); + }, 1); }, /** From 47dd649066b3c99df6112c9df75823da7514a4a7 Mon Sep 17 00:00:00 2001 From: omarkasem Date: Tue, 10 Sep 2024 07:37:06 +0300 Subject: [PATCH 03/37] Fixes multiple messages showing up --- assets/js/fe-views.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/assets/js/fe-views.js b/assets/js/fe-views.js index 903a12b553..7bab7840bd 100644 --- a/assets/js/fe-views.js +++ b/assets/js/fe-views.js @@ -85,6 +85,11 @@ jQuery( function ( $ ) { return true; } + // Check if message already exists + if($("#" + up.settings.gf_vars.message_id).length > 0){ + return true; + } + $( "#" + up.settings.gf_vars.message_id ).prepend( "
  • " + $('
    ').text(gform_gravityforms.strings.max_reached).html() + From 572e0fa0287a9cf6783d70fb83438576bb4751ba Mon Sep 17 00:00:00 2001 From: omarkasem Date: Fri, 13 Sep 2024 11:24:19 +0300 Subject: [PATCH 04/37] Fixes issue that allowed user to uplaod files more than the maximum --- assets/js/fe-views.js | 18 +++++++++++++++--- assets/js/fe-views.min.js | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/assets/js/fe-views.js b/assets/js/fe-views.js index 7bab7840bd..6dc48e4f41 100644 --- a/assets/js/fe-views.js +++ b/assets/js/fe-views.js @@ -70,7 +70,7 @@ jQuery( function ( $ ) { gfMultiFileUploader.toggleDisabled(data, limitReached); }); - uploader.bind('FilesAdded', function(up, params) { + uploader.bind('FilesAdded', function(up, files) { var data = up.settings; var max = data.gf_vars.max_files; var fieldId = data.multipart_params.field_id; @@ -78,18 +78,30 @@ jQuery( function ( $ ) { var newFilesCount = $('#gform_preview_'+formId+'_'+fieldId).children().length; var existingFilesCount = $('#preview_existing_files_'+fieldId).children().length; var limitReached = existingFilesCount + newFilesCount >= max; + + $.each(files, function(i, file) { + if (max > 0 && existingFilesCount >= max){ + up.removeFile(file); + $('#'+file.id).remove(); + return; + } + + existingFilesCount++; + }); + gfMultiFileUploader.toggleDisabled(data, limitReached); + // Only show message if max is greater than 1 if(max <= 1){ return true; } // Check if message already exists - if($("#" + up.settings.gf_vars.message_id).length > 0){ + + if($("#" + up.settings.gf_vars.message_id).children().length > 0){ return true; } - $( "#" + up.settings.gf_vars.message_id ).prepend( "
  • " + $('
    ').text(gform_gravityforms.strings.max_reached).html() + diff --git a/assets/js/fe-views.min.js b/assets/js/fe-views.min.js index 39fa1f877f..d1e4f147fc 100644 --- a/assets/js/fe-views.min.js +++ b/assets/js/fe-views.min.js @@ -1 +1 @@ -jQuery(function($){({init:function(){this.datepicker(),$(".gv-widget-search").each(function(){$(this).attr("data-state",$(this).serialize())}),$(".gv-widget-search").on("keyup, change",this.form_changed),$(".gv-widget-search .gv-search-field-search_all input[type=search]").on("search",function(e){$(e.target).parents("form").trigger("keyup")}),$(".gv-search-clear").on("click",this.clear_search),$("a.gv-sort").on("click",this.multiclick_sort),this.number_range()},form_changed:function($form){$form=$($form.target).hasClass("gv-widget-search")?$($form.target):$($form.target).parents("form");$form.serialize()===$form.attr("data-state")?$form.hasClass("gv-is-search")?$(".gv-search-clear",$(this)).text(gvGlobals.clear):$(".gv-search-clear",$(this)).fadeOut(100):$(".gv-search-clear",$(this)).text(gvGlobals.reset).fadeIn(100)},clear_search:function(e){var $form=$(this).parents("form"),changed=$form.attr("data-state")!==$form.serialize();return!(!$form.hasClass("gv-is-search")||changed)||(!changed||(e.preventDefault(),$form.trigger("reset"),!1===$form.hasClass("gv-is-search")?$(".gv-search-clear",$form).hide(100):$(".gv-search-clear",$form).text(gvGlobals.clear),!1))},datepicker:function(){jQuery.fn.datepicker&&$(".gv-datepicker").each(function(){var element=jQuery(this),format="",showOn="focus";element.hasClass("datepicker_with_icon")&&(showOn="both",format=jQuery("#gforms_calendar_icon_"+this.id).val()),gvGlobals.datepicker.showOn=showOn,gvGlobals.datepicker.buttonImage=format,gvGlobals.datepicker.buttonImageOnly=!0,gvGlobals.datepicker.dateFormat||(format="mm/dd/yy",element.hasClass("mdy")?format="mm/dd/yy":element.hasClass("dmy")?format="dd/mm/yy":element.hasClass("dmy_dash")?format="dd-mm-yy":element.hasClass("dmy_dot")?format="dd.mm.yy":element.hasClass("ymd_slash")?format="yy/mm/dd":element.hasClass("ymd_dash")?format="yy-mm-dd":element.hasClass("ymd_dot")&&(format="yy.mm.dd"),gvGlobals.datepicker.dateFormat=format),element.datepicker(gvGlobals.datepicker)})},multiclick_sort:function(e){e.shiftKey&&(e.preventDefault(),location.href=$(this).data("multisort-href"))},number_range(){$(".gv-search-number-range").on("change","input",function(){const $name=$(this).attr("name"),current_type=$name.includes("max")?"max":"min",other_type="max"==current_type?"min":"max",$other=$(this).closest(".gv-search-number-range").find('input[name="'+$name.replace(/(min|max)/,other_type)+'"]');setTimeout(function(){var value;$(this).attr(other_type)&&""!==$(this).val()&&(value=parseFloat($(this).val()),"max"==current_type&&valueparseFloat($(this).attr("max"))&&$(this).val($(this).attr("max"))),$other.attr(current_type,$(this).val())}.bind(this),2)}).find("input").trigger("change")}}).init()}); \ No newline at end of file +jQuery(function($){({init:function(){this.datepicker(),$(".gv-widget-search").each(function(){$(this).attr("data-state",$(this).serialize())}),$(".gv-widget-search").on("keyup, change",this.form_changed),$(".gv-widget-search .gv-search-field-search_all input[type=search]").on("search",function(e){$(e.target).parents("form").trigger("keyup")}),$(".gv-search-clear").on("click",this.clear_search),$("a.gv-sort").on("click",this.multiclick_sort),this.disable_upload_file_when_limit_reached(),this.fix_updating_files_after_edit(),this.number_range()},fix_updating_files_after_edit:function(){$.each($(".ginput_preview_list"),function(index,element){return 0<$(element).children().length||void $(element).parents("form").find("[name=gform_uploaded_files]").val("")})},disable_upload_file_when_limit_reached:function(){var checkUploaders=setInterval(function(){"undefined"!=typeof gfMultiFileUploader&&gfMultiFileUploader.uploaders&&(clearInterval(checkUploaders),$.each(gfMultiFileUploader.uploaders,function(index,uploader){uploader.bind("Init",function(existingFilesCount,params){var data=existingFilesCount.settings,max=data.gf_vars.max_files,existingFilesCount=data.multipart_params.field_id,existingFilesCount=$("#preview_existing_files_"+existingFilesCount).children().length;gfMultiFileUploader.toggleDisabled(data,max<=existingFilesCount)}),uploader.bind("FilesAdded",function(up,files){var data=up.settings,max=data.gf_vars.max_files,fieldId=data.multipart_params.field_id,limitReached=data.multipart_params.form_id,limitReached=$("#gform_preview_"+limitReached+"_"+fieldId).children().length,existingFilesCount=$("#preview_existing_files_"+fieldId).children().length,limitReached=max<=existingFilesCount+limitReached;return $.each(files,function(i,file){return 0"+$("
    ").text(gform_gravityforms.strings.max_reached).html()+"
  • "),void setTimeout(function(){wp.a11y.speak($("#"+up.settings.gf_vars.message_id).text())},1e3)))})}))},1)},form_changed:function($form){$form=$($form.target).hasClass("gv-widget-search")?$($form.target):$($form.target).parents("form");$form.serialize()===$form.attr("data-state")?$form.hasClass("gv-is-search")?$(".gv-search-clear",$(this)).text(gvGlobals.clear):$(".gv-search-clear",$(this)).fadeOut(100):$(".gv-search-clear",$(this)).text(gvGlobals.reset).fadeIn(100)},clear_search:function(e){var $form=$(this).parents("form"),changed=$form.attr("data-state")!==$form.serialize();return!(!$form.hasClass("gv-is-search")||changed)||(!changed||(e.preventDefault(),$form.trigger("reset"),!1===$form.hasClass("gv-is-search")?$(".gv-search-clear",$form).hide(100):$(".gv-search-clear",$form).text(gvGlobals.clear),!1))},datepicker:function(){jQuery.fn.datepicker&&$(".gv-datepicker").each(function(){var element=jQuery(this),format="",showOn="focus";element.hasClass("datepicker_with_icon")&&(showOn="both",format=jQuery("#gforms_calendar_icon_"+this.id).val()),gvGlobals.datepicker.showOn=showOn,gvGlobals.datepicker.buttonImage=format,gvGlobals.datepicker.buttonImageOnly=!0,gvGlobals.datepicker.dateFormat||(format="mm/dd/yy",element.hasClass("mdy")?format="mm/dd/yy":element.hasClass("dmy")?format="dd/mm/yy":element.hasClass("dmy_dash")?format="dd-mm-yy":element.hasClass("dmy_dot")?format="dd.mm.yy":element.hasClass("ymd_slash")?format="yy/mm/dd":element.hasClass("ymd_dash")?format="yy-mm-dd":element.hasClass("ymd_dot")&&(format="yy.mm.dd"),gvGlobals.datepicker.dateFormat=format),element.datepicker(gvGlobals.datepicker)})},multiclick_sort:function(e){e.shiftKey&&(e.preventDefault(),location.href=$(this).data("multisort-href"))},number_range(){$(".gv-search-number-range").on("change","input",function(){const $name=$(this).attr("name"),current_type=$name.includes("max")?"max":"min",other_type="max"==current_type?"min":"max",$other=$(this).closest(".gv-search-number-range").find('input[name="'+$name.replace(/(min|max)/,other_type)+'"]');setTimeout(function(){var value;$(this).attr(other_type)&&""!==$(this).val()&&(value=parseFloat($(this).val()),"max"==current_type&&valueparseFloat($(this).attr("max"))&&$(this).val($(this).attr("max"))),$other.attr(current_type,$(this).val())}.bind(this),2)}).find("input").trigger("change")}}).init()}); \ No newline at end of file From 24c81c2538ce93092ff331c911dced7f2a9fd640 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Tue, 28 May 2024 16:55:18 +0200 Subject: [PATCH 05/37] Find associated field by field name instead of type first. --- includes/fields/class-gravityview-fields.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/includes/fields/class-gravityview-fields.php b/includes/fields/class-gravityview-fields.php index fbfab77456..06054ce51f 100644 --- a/includes/fields/class-gravityview-fields.php +++ b/includes/fields/class-gravityview-fields.php @@ -93,11 +93,20 @@ public static function get( $field_name ) { * @return GravityView_Field|false Returns false if no matching fields found */ public static function get_associated_field( $gf_field ) { - - $field_type = is_a( $gf_field, 'GF_Field' ) ? get_class( $gf_field ) : $gf_field; + $is_field = $gf_field instanceof GF_Field; + $field_class = $is_field ? get_class( $gf_field ) : $gf_field; + $field_name = $is_field && ! is_numeric( $gf_field->id ) ? $gf_field->id : null; + + if ( $field_name ) { + foreach ( self::$_fields as $field ) { + if ( $field_name === $field->name ) { + return $field; + } + } + } foreach ( self::$_fields as $field ) { - if ( $field_type === $field->_gf_field_class_name ) { + if ( $field_class === $field->_gf_field_class_name ) { return $field; } } From 5c54a9e5a75d2f35a85f54e85c37a61609e162e3 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Tue, 28 May 2024 16:57:39 +0200 Subject: [PATCH 06/37] Add created_by field rendering for edit view. --- .../class-gravityview-field-created-by.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/includes/fields/class-gravityview-field-created-by.php b/includes/fields/class-gravityview-field-created-by.php index b842ddaaf2..f668cf5725 100644 --- a/includes/fields/class-gravityview-field-created-by.php +++ b/includes/fields/class-gravityview-field-created-by.php @@ -153,6 +153,25 @@ public function field_options( $field_options, $template_id, $field_id, $context return $field_options; } + + /** + * Returns the HTML for the field input. + * + * @since $ver$ + * + * @param array $form The form object. + * @param mixed $value The field value. + * @param array $entry The entry object. + * @param GF_Field $field The field object. + * + * @return string The input HTML. + */ + public function get_field_input( array $form, $value, array $entry, GF_Field $field ): string { + return sprintf( + '
    %s
    ', + GravityView_Change_Entry_Creator::get_select_field( $entry ) + ); + } } new GravityView_Field_Created_By(); From 77a8113fd74ccc61734ae5a7e2719260578fce92 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Tue, 28 May 2024 16:59:36 +0200 Subject: [PATCH 07/37] Add ability to change created by user: - Add Created By (User) field to the edit screen - Renders the field on the entry form - Stores the value when the user has the correct rights - Refactored to get original user from old entry data instead of post value --- ...class-gravityview-change-entry-creator.php | 194 +++++++++++++++--- 1 file changed, 166 insertions(+), 28 deletions(-) diff --git a/includes/class-gravityview-change-entry-creator.php b/includes/class-gravityview-change-entry-creator.php index 7b7cb2fa77..3507fed1ad 100644 --- a/includes/class-gravityview-change-entry-creator.php +++ b/includes/class-gravityview-change-entry-creator.php @@ -17,21 +17,21 @@ function __construct() { */ add_action( 'gform_user_registered', array( $this, 'assign_new_user_to_lead' ), 10, 4 ); - // ONLY ADMIN FROM HERE ON. - if ( ! is_admin() ) { - return; - } - /** * Disable the Change Entry Creator functionality. * * @since 1.7.4 + * * @param boolean $disable Disable the Change Entry Creator functionality. Default: false. */ if ( apply_filters( 'gravityview_disable_change_entry_creator', false ) ) { return; } + add_filter( 'gravityview_entry_default_fields', [ $this, 'register_edit_field' ], 10, 3 ); + add_filter( 'gravityview/edit_entry/form_fields', [ $this, 'register_created_by_input' ], 10, 3 ); + add_filter( 'gravityview_field_visibility_caps', [ $this, 'created_by_visibility_caps' ], 15, 3 ); + /** * Use `init` to fix bbPress warning * @@ -76,7 +76,10 @@ function enqueue_selectwoo_assets() { wp_enqueue_script( 'gravityview_selectwoo', plugins_url( 'assets/lib/selectWoo/selectWoo.full.min.js', GRAVITYVIEW_FILE ), array(), $version ); wp_enqueue_style( 'gravityview_selectwoo', plugins_url( 'assets/lib/selectWoo/selectWoo.min.css', GRAVITYVIEW_FILE ), array(), $version ); - wp_enqueue_script( 'gravityview_entry_creator', plugins_url( 'assets/js/admin-entry-creator' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( 'jquery', 'gravityview_selectwoo' ), $version ); + wp_enqueue_script( 'gravityview_entry_creator', plugins_url( 'assets/js/admin-entry-creator' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( + 'jquery', + 'gravityview_selectwoo' + ), $version ); wp_localize_script( 'gravityview_entry_creator', @@ -134,10 +137,12 @@ function entry_creator_get_users() { * When an user is created using the User Registration add-on, assign the entry to them * * @since 1.5.1 + * * @param int $user_id WordPress User ID * @param array $config User registration feed configuration * @param array $entry GF Entry array * @param string $password User password + * * @return void * @uses RGFormsModel::update_lead_property() Modify the entry `created_by` field */ @@ -175,6 +180,7 @@ function assign_new_user_to_lead( $user_id, $config, $entry = array(), $password * Disable adding a note when changing the entry creator. * * @since 1.21.5 + * * @param boolean $disable Disable the Change Entry Creator note. Default: false. */ if ( apply_filters( 'gravityview_disable_change_entry_creator_note', false ) ) { @@ -197,6 +203,23 @@ function prevent_conflicts() { remove_action( 'gform_after_update_entry', 'gravityview_update_entry_creator', 10 ); } + /** + * Whether the current user has the rights to edit the entry creator. + * + * @since $ver$ + * + * @return bool Whether the user has rights. + */ + private function is_user_allowed(): bool { + // Todo: only show users if the user has rights to see all users. + // Can the user edit entries? + if ( ! GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_entries' ) ) ) { + return false; + } + + return true; + } + /** * @since 3.6.3 * @return void @@ -209,12 +232,21 @@ function load() { } // Can the user edit entries? - if ( ! GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_entries' ) ) ) { + if ( ! $this->is_user_allowed() ) { return; } - // If screen mode isn't set, then we're in the wrong place. - if ( empty( $_REQUEST['screen_mode'] ) ) { + /** + * If screen mode isn't set, then we're in the wrong place. + * But if we posted a valid nonce, then we are legit. + */ + if ( + empty( $_REQUEST['screen_mode'] ) + && ( + ! rgpost( 'gv_entry_creator_nonce' ) + || ! wp_verify_nonce( rgpost( 'gv_entry_creator_nonce' ), 'gv_entry_creator' ) + ) + ) { return; } @@ -223,7 +255,7 @@ function load() { add_action( 'gform_entry_info', array( &$this, 'add_select' ), 10, 2 ); - add_action( 'gform_after_update_entry', array( &$this, 'update_entry_creator' ), 10, 2 ); + add_action( 'gform_after_update_entry', array( &$this, 'update_entry_creator' ), 10, 3 ); } /** @@ -248,9 +280,10 @@ function set_screen_mode() { * * @param array $form GF entry array * @param int $entry_id Entry ID + * * @return void */ - function update_entry_creator( $form, $entry_id ) { + function update_entry_creator( $form, $entry_id, array $original_entry ) { global $current_user; @@ -260,7 +293,7 @@ function update_entry_creator( $form, $entry_id ) { RGFormsModel::update_lead_property( $entry_id, 'created_by', $created_by ); // If the creator has changed, let's add a note about who it used to be. - $originally_created_by = \GV\Utils::_POST( 'originally_created_by' ); + $originally_created_by = rgar( $original_entry, 'created_by' ); // If there's no owner and there didn't used to be, keep going if ( empty( $originally_created_by ) && empty( $created_by ) ) { @@ -297,23 +330,16 @@ function update_entry_creator( $form, $entry_id ) { } /** - * Output select element used to change the entry creator + * Returns the HTML for the user select field. * - * @param int $form_id GF Form ID - * @param array $entry GF entry array + * @since $ver$ * - * @return void + * @param array $entry The entry object. + * + * @return string The HTML. */ - function add_select( $form_id, $entry ) { - - if ( 'edit' !== \GV\Utils::_POST( 'screen_mode' ) ) { - return; - } - - $output = ''; - $output .= ''; $entry_creator_user_id = \GV\Utils::get( $entry, 'created_by' ); @@ -344,13 +370,34 @@ function add_select( $form_id, $entry ) { $user_users = _n( esc_html__( 'user', 'gk-gravityview' ), esc_html__( 'users', 'gk-gravityview' ), $remaining_users ); $message = esc_html_x( 'Use the input above to search the remaining %1$d %2$s.', '%d is replaced with user count %s is replaced with "user" or "users"', 'gk-gravityview' ); $message = sprintf( $message, $remaining_users, $user_users ); - $output .= ''; + $output .= ''; } $output .= ''; - $output .= ''; $output .= wp_nonce_field( 'gv_entry_creator', 'gv_entry_creator_nonce', false, false ); + return $output; + } + + /** + * Output select element used to change the entry creator + * + * @param int $form_id GF Form ID + * @param array $entry GF entry array + * + * @return void + */ + function add_select( $form_id, $entry ) { + + if ( 'edit' !== \GV\Utils::_POST( 'screen_mode' ) ) { + return; + } + + $output = ''; + $output .= self::get_select_field( $entry ); + echo $output; } @@ -367,6 +414,97 @@ function register_gform_noconflict( $assets ) { return $assets; } + + /** + * Registers the `created_by` field on the `Edit Entry` tab. + * + * @since $ver$ + * + * @param GF_Field[] $fields The registered fields. + * @param array $form The form object. + * @param string $zone The fields zone. + * + * @return array The updated fields array. + */ + public function register_edit_field( array $fields, array $form, string $zone ): array { + if ( 'edit' !== $zone ) { + return $fields; + } + + $meta_fields = GravityView_Fields::get_all( array( 'meta', 'gravityview' ), $zone ); + $field = $meta_fields['created_by'] ?? null; + + if ( $field ) { + $fields += $field->as_array(); + } + + return $fields; + } + + /** + * Registers the `created_by` field on the `Edit Entry` tab. + * + * @since $ver$ + * + * @param GF_Field[] $fields The registered fields. + * @param array|null $editable_fields The fields zone. + * @param array $form The form object. + * + * @return array The updated fields array. + */ + public function register_created_by_input( array $fields, ?array $editable_fields, array $form ): array { + // Don't add the `created_by` field if the user can't change it. + $editable_field_ids = array_flip( array_map( static function ( array $field ): string { + return $field['id'] ?? 0; + }, $editable_fields ?? [] ) ); + + $form = GFExport::add_default_export_fields( $form ); + $form_fields = array_column( $form['fields'], null, 'id' ); + + // Don't show field automatically, only when actively added. + if ( null === $editable_fields || ! isset( $editable_field_ids['created_by'] ) ) { + return $fields; + } + + $configuration = $editable_fields[ $editable_field_ids['created_by'] ] ?? []; + + if ( ! GVCommon::has_cap( array( $configuration['allow_edit_cap'] ?? 'manage_options' ) ) ) { + return $fields; + } + + $fields[] = $form_fields['created_by']; + + // Sort fields according to Gravity View. + $sort_order_lookup = array_flip( array_keys( $editable_field_ids ) ); + + uasort( $fields, static function ( GF_Field $a, GF_Field $b ) use ( $sort_order_lookup ): int { + return $sort_order_lookup[ $a->id ] ?? 0 <=> $sort_order_lookup[ $b->id ]; + } ); + + return $fields; + } + + /** + * Manages the visibility capabilities for the `created_by` field on the edit page. + * + * @since $ver$ + * + * @param array $caps The capabilities. + * @param string $template The template name. + * @param string $field The field name. + * + * @return array The new capabilities. + */ + public function created_by_visibility_caps( array $caps, string $template, string $field ): array { + if ( 'created_by' !== $field || false === strpos( $template, 'edit' ) ) { + return $caps; + } + + // Read users can't update the `created_by` field. + unset ( $caps['read'] ); + + return $caps; + } } new GravityView_Change_Entry_Creator(); From 18b10c502c04b117407e87359a5c63b955618a9e Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Mon, 16 Sep 2024 15:06:47 +0200 Subject: [PATCH 08/37] Add check for `list_users` and update readme --- ...class-gravityview-change-entry-creator.php | 57 +++++++++++-------- readme.txt | 1 + 2 files changed, 34 insertions(+), 24 deletions(-) diff --git a/includes/class-gravityview-change-entry-creator.php b/includes/class-gravityview-change-entry-creator.php index 3507fed1ad..9d2217771e 100644 --- a/includes/class-gravityview-change-entry-creator.php +++ b/includes/class-gravityview-change-entry-creator.php @@ -8,9 +8,9 @@ class GravityView_Change_Entry_Creator { /* * @var int Number of users to show in the select element */ - const DEFAULT_NUMBER_OF_USERS = 100; + public const DEFAULT_NUMBER_OF_USERS = 100; - function __construct() { + public function __construct() { /** * @since 1.5.1 @@ -55,7 +55,7 @@ function __construct() { * * @since 2.9.1 */ - function enqueue_selectwoo_assets() { + public function enqueue_selectwoo_assets() { if ( ! class_exists( 'GFForms' ) ) { return; @@ -76,10 +76,12 @@ function enqueue_selectwoo_assets() { wp_enqueue_script( 'gravityview_selectwoo', plugins_url( 'assets/lib/selectWoo/selectWoo.full.min.js', GRAVITYVIEW_FILE ), array(), $version ); wp_enqueue_style( 'gravityview_selectwoo', plugins_url( 'assets/lib/selectWoo/selectWoo.min.css', GRAVITYVIEW_FILE ), array(), $version ); - wp_enqueue_script( 'gravityview_entry_creator', plugins_url( 'assets/js/admin-entry-creator' . $script_debug . '.js', GRAVITYVIEW_FILE ), array( - 'jquery', - 'gravityview_selectwoo' - ), $version ); + wp_enqueue_script( + 'gravityview_entry_creator', + plugins_url( 'assets/js/admin-entry-creator' . $script_debug . '.js', GRAVITYVIEW_FILE ), + [ 'jquery', 'gravityview_selectwoo' ], + $version + ); wp_localize_script( 'gravityview_entry_creator', @@ -100,7 +102,7 @@ function enqueue_selectwoo_assets() { * * @since 2.9.1 */ - function entry_creator_get_users() { + public function entry_creator_get_users() { $post_var = wp_parse_args( wp_unslash( $_POST ), @@ -146,7 +148,7 @@ function entry_creator_get_users() { * @return void * @uses RGFormsModel::update_lead_property() Modify the entry `created_by` field */ - function assign_new_user_to_lead( $user_id, $config, $entry = array(), $password = '' ) { + public function assign_new_user_to_lead( $user_id, $config, $entry = array(), $password = '' ) { /** * Disable assigning the new user to the entry by returning false. @@ -195,7 +197,7 @@ function assign_new_user_to_lead( $user_id, $config, $entry = array(), $password * * @return void */ - function prevent_conflicts() { + public function prevent_conflicts() { // Plugin that was provided here: // @link https://www.gravitykit.com/support/documentation/201991205/ @@ -211,9 +213,17 @@ function prevent_conflicts() { * @return bool Whether the user has rights. */ private function is_user_allowed(): bool { - // Todo: only show users if the user has rights to see all users. + if ( ! GVCommon::has_cap( 'list_users' ) ) { + return false; + } + // Can the user edit entries? - if ( ! GVCommon::has_cap( array( 'gravityforms_edit_entries', 'gravityview_edit_entries' ) ) ) { + if ( ! GVCommon::has_cap( [ + 'gravityforms_edit_entries', + 'gravityview_edit_entries', + 'gravityview_edit_others_entries', + 'gravityview_edit_form_entries', + ] ) ) { return false; } @@ -224,7 +234,7 @@ private function is_user_allowed(): bool { * @since 3.6.3 * @return void */ - function load() { + public function load() { // Does GF exist? if ( ! class_exists( 'GFCommon' ) ) { @@ -251,11 +261,9 @@ function load() { } // Now, no validation is required in the methods; let's hook in. - add_action( 'admin_init', array( &$this, 'set_screen_mode' ) ); - - add_action( 'gform_entry_info', array( &$this, 'add_select' ), 10, 2 ); - - add_action( 'gform_after_update_entry', array( &$this, 'update_entry_creator' ), 10, 3 ); + add_action( 'admin_init', [ $this, 'set_screen_mode' ] ); + add_action( 'gform_entry_info', [ $this, 'add_select' ], 10, 2 ); + add_action( 'gform_after_update_entry', [ $this, 'update_entry_creator' ], 10, 3 ); } /** @@ -263,7 +271,7 @@ function load() { * * @return void */ - function set_screen_mode() { + public function set_screen_mode() { if ( 'view' === \GV\Utils::_POST( 'screen_mode' ) ) { return; @@ -278,12 +286,13 @@ function set_screen_mode() { /** * When the entry creator is changed, add a note to the entry * - * @param array $form GF entry array - * @param int $entry_id Entry ID + * @param array $form GF entry array + * @param int $entry_id Entry ID + * @param array $original_entry The entry before updating. * * @return void */ - function update_entry_creator( $form, $entry_id, array $original_entry ) { + public function update_entry_creator( $form, $entry_id, array $original_entry ) { global $current_user; @@ -387,7 +396,7 @@ public static function get_select_field( array $entry ): string { * * @return void */ - function add_select( $form_id, $entry ) { + public function add_select( $form_id, $entry ) { if ( 'edit' !== \GV\Utils::_POST( 'screen_mode' ) ) { return; @@ -408,7 +417,7 @@ function add_select( $form_id, $entry ) { * * @return array */ - function register_gform_noconflict( $assets ) { + public function register_gform_noconflict( $assets ) { $assets[] = 'gravityview_selectwoo'; $assets[] = 'gravityview_entry_creator'; diff --git a/readme.txt b/readme.txt index 5bd438f4b0..55c77b453f 100644 --- a/readme.txt +++ b/readme.txt @@ -23,6 +23,7 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h = develop = +* Added: Entry creator can be changed from the Edit Entry Layout. * Fixed: Clearing search removed all URL query parameters and under some circumstances redirected to the homepage. * Fixed: Searching the View added duplicate search parameters to the URL. * Fixed: PHP 8.2 deprecation notice related to dynamic property creation. From dff1b6c22517739ab3c426428e1d04fc6ead83f8 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Mon, 16 Sep 2024 15:36:52 +0200 Subject: [PATCH 09/37] Fix Code style problems --- ...class-gravityview-change-entry-creator.php | 128 ++++++++++-------- 1 file changed, 74 insertions(+), 54 deletions(-) diff --git a/includes/class-gravityview-change-entry-creator.php b/includes/class-gravityview-change-entry-creator.php index 9d2217771e..dd662a4b48 100644 --- a/includes/class-gravityview-change-entry-creator.php +++ b/includes/class-gravityview-change-entry-creator.php @@ -4,18 +4,22 @@ * @since 1.2 */ class GravityView_Change_Entry_Creator { - - /* - * @var int Number of users to show in the select element + /** + * Number of users to show in the select element. + * + * @var int */ public const DEFAULT_NUMBER_OF_USERS = 100; + /** + * Initializes the hooks. + */ public function __construct() { /** * @since 1.5.1 */ - add_action( 'gform_user_registered', array( $this, 'assign_new_user_to_lead' ), 10, 4 ); + add_action( 'gform_user_registered', array( $this, 'assign_new_user_to_lead' ), 10, 3 ); /** * Disable the Change Entry Creator functionality. @@ -33,7 +37,7 @@ public function __construct() { add_filter( 'gravityview_field_visibility_caps', [ $this, 'created_by_visibility_caps' ], 15, 3 ); /** - * Use `init` to fix bbPress warning + * Use `init` to fix bbPress warning. * * @see https://bbpress.trac.wordpress.org/ticket/2309 */ @@ -41,7 +45,7 @@ public function __construct() { add_action( 'plugins_loaded', array( $this, 'prevent_conflicts' ) ); - // Enqueue and allow selectWoo UI assets + // Enqueue and allow selectWoo UI assets. add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_selectwoo_assets' ) ); add_filter( 'gform_noconflict_scripts', array( $this, 'register_gform_noconflict' ) ); add_filter( 'gform_noconflict_styles', array( $this, 'register_gform_noconflict' ) ); @@ -61,7 +65,7 @@ public function enqueue_selectwoo_assets() { return; } - if ( ! in_array( GFForms::get_page(), array( 'entry_detail_edit' ) ) ) { + if ( GFForms::get_page() !== 'entry_detail_edit' ) { return; } @@ -136,19 +140,18 @@ public function entry_creator_get_users() { } /** - * When an user is created using the User Registration add-on, assign the entry to them + * When a user is created using the User Registration add-on, assign the entry to them. * * @since 1.5.1 * - * @param int $user_id WordPress User ID - * @param array $config User registration feed configuration - * @param array $entry GF Entry array - * @param string $password User password + * @param int $user_id WordPress User ID. + * @param array $config User registration feed configuration. + * @param array $entry GF Entry array. * * @return void - * @uses RGFormsModel::update_lead_property() Modify the entry `created_by` field + * @uses RGFormsModel::update_lead_property() Modify the entry `created_by` field. */ - public function assign_new_user_to_lead( $user_id, $config, $entry = array(), $password = '' ) { + public function assign_new_user_to_lead( $user_id, $config, $entry = array() ) { /** * Disable assigning the new user to the entry by returning false. @@ -159,12 +162,12 @@ public function assign_new_user_to_lead( $user_id, $config, $entry = array(), $p */ $assign_to_lead = apply_filters( 'gravityview_assign_new_user_to_entry', true, $user_id, $config, $entry ); - // If filter returns false, do not process + // If filter returns false, do not process. if ( empty( $assign_to_lead ) ) { return; } - // Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing + // Update the entry. The `false` prevents checking Akismet; `true` disables the user updated hook from firing. $result = RGFormsModel::update_entry_property( (int) $entry['id'], 'created_by', (int) $user_id, false, true ); if ( false === $result ) { @@ -173,7 +176,8 @@ public function assign_new_user_to_lead( $user_id, $config, $entry = array(), $p $note = sprintf( '%s: Failed to assign User ID #%d as the entry creator (Last database error: "%s")', $status, $user_id, $wpdb->last_error ); } else { $status = __( 'Success', 'gk-gravityview' ); - $note = sprintf( _x( '%1$s: Assigned User ID #%2$d as the entry creator.', 'First parameter: Success or error of the action. Second: User ID number', 'gk-gravityview' ), $status, $user_id ); + // Translators: %1$s contains either `Success` or `error`, and %2$d contains the User ID. + $note = sprintf( _x( '%1$s: Assigned User ID #%2$d as the entry creator.', 'First parameter: Success or error of the action. Second: User ID number', 'gk-gravityview' ), $status, $user_id ); } gravityview()->log->debug( 'GravityView_Change_Entry_Creator[assign_new_user_to_lead] - {note}', array( 'note' => $note ) ); @@ -198,9 +202,11 @@ public function assign_new_user_to_lead( $user_id, $config, $entry = array(), $p * @return void */ public function prevent_conflicts() { - - // Plugin that was provided here: - // @link https://www.gravitykit.com/support/documentation/201991205/ + /** + * Plugin that was provided here: + * + * @link https://www.gravitykit.com/support/documentation/201991205/ + */ remove_action( 'gform_entry_info', 'gravityview_change_entry_creator_form', 10 ); remove_action( 'gform_after_update_entry', 'gravityview_update_entry_creator', 10 ); } @@ -218,12 +224,14 @@ private function is_user_allowed(): bool { } // Can the user edit entries? - if ( ! GVCommon::has_cap( [ - 'gravityforms_edit_entries', - 'gravityview_edit_entries', - 'gravityview_edit_others_entries', - 'gravityview_edit_form_entries', - ] ) ) { + if ( ! GVCommon::has_cap( + [ + 'gravityforms_edit_entries', + 'gravityview_edit_entries', + 'gravityview_edit_others_entries', + 'gravityview_edit_form_entries', + ] + ) ) { return false; } @@ -277,17 +285,17 @@ public function set_screen_mode() { return; } - // If $_GET['screen_mode'] is set to edit, set $_POST value + // If $_GET['screen_mode'] is set to edit, set $_POST value. if ( 'edit' === \GV\Utils::_GET( 'screen_mode' ) ) { $_POST['screen_mode'] = 'edit'; } } /** - * When the entry creator is changed, add a note to the entry + * When the entry creator is changed, add a note to the entry. * - * @param array $form GF entry array - * @param int $entry_id Entry ID + * @param array $form GF entry array. + * @param int $entry_id Entry ID. * @param array $original_entry The entry before updating. * * @return void @@ -296,7 +304,7 @@ public function update_entry_creator( $form, $entry_id, array $original_entry ) global $current_user; - // Update the entry + // Update the entry. $created_by = absint( \GV\Utils::_POST( 'created_by' ) ); RGFormsModel::update_lead_property( $entry_id, 'created_by', $created_by ); @@ -304,19 +312,21 @@ public function update_entry_creator( $form, $entry_id, array $original_entry ) // If the creator has changed, let's add a note about who it used to be. $originally_created_by = rgar( $original_entry, 'created_by' ); - // If there's no owner and there didn't used to be, keep going + // If there's no owner and there didn't used to be, keep going. if ( empty( $originally_created_by ) && empty( $created_by ) ) { return; } - // If the values have changed + // If the values have changed. if ( absint( $originally_created_by ) !== absint( $created_by ) ) { $user_data = get_userdata( $current_user->ID ); + // Translators: %1$s contains the user's name, and %2$d contains the user ID. $user_format = _x( '%1$s (ID #%2$d)', 'The name and the ID of users who initiated changes to entry ownership', 'gk-gravityview' ); - $original_name = $created_by_name = esc_attr_x( 'No User', 'To show that the entry was unassigned from an actual user to no user.', 'gk-gravityview' ); + $created_by_name = esc_attr_x( 'No User', 'To show that the entry was unassigned from an actual user to no user.', 'gk-gravityview' ); + $original_name = $created_by_name; if ( ! empty( $originally_created_by ) ) { $originally_created_by_user_data = get_userdata( $originally_created_by ); @@ -334,6 +344,7 @@ public function update_entry_creator( $form, $entry_id, array $original_entry ) esc_attr_x( 'Deleted User', 'To show that the entry was created by a no longer existing user.', 'gk-gravityview' ); } + // Translators: %1$s contains the original user's name, %2$s contains the new user's name. GravityView_Entry_Notes::add_note( $entry_id, $current_user->ID, $user_data->display_name, sprintf( __( 'Changed entry creator from %1$s to %2$s', 'gk-gravityview' ), $original_name, $created_by_name ), 'note' ); } } @@ -357,7 +368,7 @@ public static function get_select_field( array $entry ): string { $output .= ''; - // Always show the entry creator, even when the user isn't included within the pagination limits + // Always show the entry creator, even when the user isn't included within the pagination limits. if ( ! empty( $entry_creator_user_id ) && ! empty( $entry_creator_user ) ) { $output .= ''; } @@ -376,10 +387,11 @@ public static function get_select_field( array $entry ): string { $users_displayed = self::DEFAULT_NUMBER_OF_USERS + ( ! empty( $entry_creator_user ) ? 1 : 0 ); if ( $user_count > $users_displayed ) { $remaining_users = $user_count - $users_displayed; - $user_users = _n( esc_html__( 'user', 'gk-gravityview' ), esc_html__( 'users', 'gk-gravityview' ), $remaining_users ); - $message = esc_html_x( 'Use the input above to search the remaining %1$d %2$s.', '%d is replaced with user count %s is replaced with "user" or "users"', 'gk-gravityview' ); - $message = sprintf( $message, $remaining_users, $user_users ); - $output .= ''; + $user_users = _n( 'user', 'users', $remaining_users, 'gk-gravityview' ); + // Translators: %1$d is the user count, %2$s is either `user` or `users` (singular vs. plural). + $message = esc_html_x( 'Use the input above to search the remaining %1$d %2$s.', '%d is replaced with user count %s is replaced with "user" or "users"', 'gk-gravityview' ); + $message = sprintf( $message, $remaining_users, $user_users ); + $output .= ''; } $output .= ''; @@ -389,10 +401,10 @@ public static function get_select_field( array $entry ): string { } /** - * Output select element used to change the entry creator + * Output select element used to change the entry creator. * - * @param int $form_id GF Form ID - * @param array $entry GF entry array + * @param int $form_id GF Form ID. + * @param array $entry GF entry array. * * @return void */ @@ -402,20 +414,20 @@ public function add_select( $form_id, $entry ) { return; } - $output = ''; $output .= self::get_select_field( $entry ); - echo wp_kses( $output ); + echo wp_kses( + $output, + [ + 'label' => [ 'for' => true ], + 'select' => [ + 'id' => true, + 'name' => true, + 'class' => true, + ], + 'option' => [ + 'value' => true, + 'selected' => true, + 'disabled' => true, + ], + ] + ); } /** From a7c05e1f715c87738d9c84c29044d2cc640af838 Mon Sep 17 00:00:00 2001 From: omarkasem Date: Tue, 17 Sep 2024 09:43:48 +0300 Subject: [PATCH 11/37] Add merge tags for dates function --- includes/class-gravityview-merge-tags.php | 48 +++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/includes/class-gravityview-merge-tags.php b/includes/class-gravityview-merge-tags.php index 8a03abf565..a4150d6d0f 100644 --- a/includes/class-gravityview-merge-tags.php +++ b/includes/class-gravityview-merge-tags.php @@ -463,6 +463,54 @@ public static function replace_gv_merge_tags( $text, $form = array(), $entry = a $text = self::replace_entry_link( $text, $form, $entry, $url_encode, $esc_html ); + $text = self::replace_merge_tags_dates( $text, $form, $entry, $url_encode, $esc_html ); + + return $text; + } + + + /** + * Replace date merge tags in the text. + * + * @since TBD + * + * @param string $text The text containing merge tags. + * @param array $form The Gravity Forms form array. + * @param array $entry The entry array. + * @param bool $url_encode Whether to URL-encode output. + * @param bool $esc_html Whether to apply `esc_html()` to output. + * + * @return string The text with date merge tags replaced. + */ + public static function replace_merge_tags_dates( $text, $form, $entry, $url_encode, $esc_html ) { + + if ( strpos( $text, '{' ) === false ) { + return $text; + } + + preg_match_all( '/{(now|yesterday|tomorrow):?(.*?)(?:\s)?}/ism', $text, $matches, PREG_SET_ORDER ); + if ( ! empty( $matches ) ) { + + $utc_timestamp = time(); + $local_timestamp = GFCommon::get_local_timestamp( $utc_timestamp ); + + $replacements = array( + 'now' => date_i18n( 'Y-m-d H:i:s', $local_timestamp, true ), + 'yesterday' => date_i18n( 'Y-m-d H:i:s', $local_timestamp - DAY_IN_SECONDS, true ), + 'tomorrow' => date_i18n( 'Y-m-d H:i:s', $local_timestamp + DAY_IN_SECONDS, true ), + ); + + foreach ( $matches as $match ) { + $full_tag = $match[0]; + $replaceable_date = $replacements[$match[1]]; + $modifier = $match[2]; + + $formatted_date = self::format_date( $replaceable_date, $modifier ); + $text = str_replace( $full_tag, $formatted_date, $text ); + } + + } + return $text; } From bb612e4c132654900cfe0fb9dabbd190f2606d6b Mon Sep 17 00:00:00 2001 From: omarkasem Date: Tue, 17 Sep 2024 10:26:21 +0300 Subject: [PATCH 12/37] Add unit tests --- .../GravityView_Merge_Tags_Test.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/tests/unit-tests/GravityView_Merge_Tags_Test.php b/tests/unit-tests/GravityView_Merge_Tags_Test.php index ba379ca66e..86d0a92754 100644 --- a/tests/unit-tests/GravityView_Merge_Tags_Test.php +++ b/tests/unit-tests/GravityView_Merge_Tags_Test.php @@ -343,6 +343,37 @@ function test_replace_date_updated() { return $this->test_replace_date_created_and_updated( 'date_updated' ); } + /** + * @covers GravityView_Merge_Tags::replace_merge_tags_dates + * @since TBD + */ + function test_replace_field_dates_merge_tags() { + + $form = $this->factory->form->create_and_get(); + + $entry = $this->factory->entry->create_and_get( array( + 'form_id' => $form['id'], + ) ); + + $tests = array( + '{now:raw}' => date_i18n( 'Y-m-d H:i:s', time(), true ), + '{now:format:Y-m-d}' => date_i18n( 'Y-m-d', time(), true ), + '{now:timestamp}' => time(), + '{tomorrow:raw}' => date_i18n( 'Y-m-d H:i:s', time() + DAY_IN_SECONDS, true ), + '{tomorrow:format:Y-m-d}' => date_i18n( 'Y-m-d', time() + DAY_IN_SECONDS, true ), + '{tomorrow:timestamp}' => time() + DAY_IN_SECONDS, + '{yesterday:raw}' => date_i18n( 'Y-m-d H:i:s', time() - DAY_IN_SECONDS, true ), + '{yesterday:format:Y-m-d}' => date_i18n( 'Y-m-d', time() - DAY_IN_SECONDS, true ), + '{yesterday:timestamp}' => time() - DAY_IN_SECONDS, + ); + + foreach ( $tests as $merge_tag => $expected ) { + $this->assertEquals( $expected, GravityView_Merge_Tags::replace_variables( $merge_tag, $form, $entry ), $merge_tag ); + } + + } + + /** * @covers GravityView_Field::replace_merge_tag * @covers GravityView_Merge_Tags::replace_is_starred From 97f8351361928bde3f1e486e197b552c9c359759 Mon Sep 17 00:00:00 2001 From: omarkasem Date: Thu, 19 Sep 2024 09:42:58 +0300 Subject: [PATCH 13/37] Fixes timestamp being different from raw format --- includes/class-gravityview-merge-tags.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/includes/class-gravityview-merge-tags.php b/includes/class-gravityview-merge-tags.php index a4150d6d0f..e462814c5d 100644 --- a/includes/class-gravityview-merge-tags.php +++ b/includes/class-gravityview-merge-tags.php @@ -494,17 +494,20 @@ public static function replace_merge_tags_dates( $text, $form, $entry, $url_enco $utc_timestamp = time(); $local_timestamp = GFCommon::get_local_timestamp( $utc_timestamp ); - $replacements = array( - 'now' => date_i18n( 'Y-m-d H:i:s', $local_timestamp, true ), - 'yesterday' => date_i18n( 'Y-m-d H:i:s', $local_timestamp - DAY_IN_SECONDS, true ), - 'tomorrow' => date_i18n( 'Y-m-d H:i:s', $local_timestamp + DAY_IN_SECONDS, true ), - ); - foreach ( $matches as $match ) { - $full_tag = $match[0]; - $replaceable_date = $replacements[$match[1]]; $modifier = $match[2]; + if( strpos( $modifier, 'timestamp' ) !== false ) { + $local_timestamp = time(); + } + + $replacements = array( + 'now' => date_i18n( 'Y-m-d H:i:s', $local_timestamp, true ), + 'yesterday' => date_i18n( 'Y-m-d H:i:s', $local_timestamp - DAY_IN_SECONDS, true ), + 'tomorrow' => date_i18n( 'Y-m-d H:i:s', $local_timestamp + DAY_IN_SECONDS, true ), + ); + $full_tag = $match[0]; + $replaceable_date = $replacements[$match[1]]; $formatted_date = self::format_date( $replaceable_date, $modifier ); $text = str_replace( $full_tag, $formatted_date, $text ); } From f861363e344422942b65c324193df705d88511e4 Mon Sep 17 00:00:00 2001 From: omarkasem Date: Mon, 30 Sep 2024 21:44:43 +0300 Subject: [PATCH 14/37] Fixes reversing issue --- templates/fields/field-survey-html.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/templates/fields/field-survey-html.php b/templates/fields/field-survey-html.php index 2a4a3738e7..ae9ff99a88 100644 --- a/templates/fields/field-survey-html.php +++ b/templates/fields/field-survey-html.php @@ -143,6 +143,12 @@ } $choices = $field->field->choices; + + // If the choices are reversed, reverse them back. + if( !empty($choices) && $choices[0]['text'] === 'Excellent' ){ + $choices = array_reverse( $choices ); + } + $choice_values = wp_list_pluck( $choices, 'value', $gravityview->value ); $starred_index = array_search( $gravityview->value, $choice_values ); $star_a11y_label = $starred_index !== false From f2f7a7338be792ee4f907ffb3c6d8ea821f90337 Mon Sep 17 00:00:00 2001 From: omarkasem Date: Mon, 30 Sep 2024 21:48:58 +0300 Subject: [PATCH 15/37] Fixes spacing --- templates/fields/field-survey-html.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/fields/field-survey-html.php b/templates/fields/field-survey-html.php index ae9ff99a88..99be953779 100644 --- a/templates/fields/field-survey-html.php +++ b/templates/fields/field-survey-html.php @@ -145,7 +145,7 @@ $choices = $field->field->choices; // If the choices are reversed, reverse them back. - if( !empty($choices) && $choices[0]['text'] === 'Excellent' ){ + if ( ! empty( $choices ) && $choices[0]['text'] === 'Excellent' ) { $choices = array_reverse( $choices ); } From cf61199bc462e2a21e4f7af7558e6556b33cea65 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 2 Oct 2024 10:58:32 -0400 Subject: [PATCH 16/37] Remove unused function parameters, format code, reuse variables @omarkasem, please play attention to these changes as we keep repeating most of them on your code. More specifically: 1) Use Yoda conditions 2) Function description should use third-person singular verb to describe what it does (see https://developer.wordpress.org/coding-standards/inline-documentation-standards/php/#documenting-tips) 3) Reuse variables if declared and do not declare variable if it's only used once 4) Pass only the required parameters to functions --- includes/class-gravityview-merge-tags.php | 52 +++++++++---------- .../GravityView_Merge_Tags_Test.php | 44 ++++++++-------- 2 files changed, 47 insertions(+), 49 deletions(-) diff --git a/includes/class-gravityview-merge-tags.php b/includes/class-gravityview-merge-tags.php index bfe70dff86..9783215c65 100644 --- a/includes/class-gravityview-merge-tags.php +++ b/includes/class-gravityview-merge-tags.php @@ -497,55 +497,51 @@ public static function replace_gv_merge_tags( $text, $form = array(), $entry = a $text = self::replace_entry_link( $text, $form, $entry, $url_encode, $esc_html ); - $text = self::replace_merge_tags_dates( $text, $form, $entry, $url_encode, $esc_html ); + $text = self::replace_merge_tags_dates( $text ); return $text; } - /** - * Replace date merge tags in the text. - * + * Replaces human-readable date merge tags with formatted dates per the modifier. + * * @since TBD * * @param string $text The text containing merge tags. - * @param array $form The Gravity Forms form array. - * @param array $entry The entry array. - * @param bool $url_encode Whether to URL-encode output. - * @param bool $esc_html Whether to apply `esc_html()` to output. * * @return string The text with date merge tags replaced. */ - public static function replace_merge_tags_dates( $text, $form, $entry, $url_encode, $esc_html ) { - - if ( strpos( $text, '{' ) === false ) { + public static function replace_merge_tags_dates( $text ) { + if ( false === strpos( $text, '{' ) ) { return $text; } preg_match_all( '/{(now|yesterday|tomorrow):?(.*?)(?:\s)?}/ism', $text, $matches, PREG_SET_ORDER ); - if ( ! empty( $matches ) ) { - $utc_timestamp = time(); - $local_timestamp = GFCommon::get_local_timestamp( $utc_timestamp ); + if ( empty( $matches ) ) { + return $text; + } - foreach ( $matches as $match ) { - $modifier = $match[2]; - if( strpos( $modifier, 'timestamp' ) !== false ) { - $local_timestamp = time(); - } + $utc_timestamp = time(); + $local_timestamp = GFCommon::get_local_timestamp( $utc_timestamp ); - $replacements = array( - 'now' => date_i18n( 'Y-m-d H:i:s', $local_timestamp, true ), - 'yesterday' => date_i18n( 'Y-m-d H:i:s', $local_timestamp - DAY_IN_SECONDS, true ), - 'tomorrow' => date_i18n( 'Y-m-d H:i:s', $local_timestamp + DAY_IN_SECONDS, true ), - ); + foreach ( $matches as $match ) { + $modifier = $match[2]; - $full_tag = $match[0]; - $replaceable_date = $replacements[$match[1]]; - $formatted_date = self::format_date( $replaceable_date, $modifier ); - $text = str_replace( $full_tag, $formatted_date, $text ); + if ( strpos( $modifier, 'timestamp' ) !== false ) { + $local_timestamp = $utc_timestamp; } + $replacements = [ + 'now' => date_i18n( 'Y-m-d H:i:s', $local_timestamp, true ), + 'yesterday' => date_i18n( 'Y-m-d H:i:s', $local_timestamp - DAY_IN_SECONDS, true ), + 'tomorrow' => date_i18n( 'Y-m-d H:i:s', $local_timestamp + DAY_IN_SECONDS, true ), + ]; + + $full_tag = $match[0]; + $replaceable_date = $replacements[ $match[1] ]; + $formatted_date = self::format_date( $replaceable_date, $modifier ); + $text = str_replace( $full_tag, $formatted_date, $text ); } return $text; diff --git a/tests/unit-tests/GravityView_Merge_Tags_Test.php b/tests/unit-tests/GravityView_Merge_Tags_Test.php index 86d0a92754..db30e78141 100644 --- a/tests/unit-tests/GravityView_Merge_Tags_Test.php +++ b/tests/unit-tests/GravityView_Merge_Tags_Test.php @@ -345,35 +345,37 @@ function test_replace_date_updated() { /** * @covers GravityView_Merge_Tags::replace_merge_tags_dates - * @since TBD + * + * @since TBD */ function test_replace_field_dates_merge_tags() { - $form = $this->factory->form->create_and_get(); - $entry = $this->factory->entry->create_and_get( array( + $entry = $this->factory->entry->create_and_get( [ 'form_id' => $form['id'], - ) ); - - $tests = array( - '{now:raw}' => date_i18n( 'Y-m-d H:i:s', time(), true ), - '{now:format:Y-m-d}' => date_i18n( 'Y-m-d', time(), true ), - '{now:timestamp}' => time(), - '{tomorrow:raw}' => date_i18n( 'Y-m-d H:i:s', time() + DAY_IN_SECONDS, true ), - '{tomorrow:format:Y-m-d}' => date_i18n( 'Y-m-d', time() + DAY_IN_SECONDS, true ), - '{tomorrow:timestamp}' => time() + DAY_IN_SECONDS, - '{yesterday:raw}' => date_i18n( 'Y-m-d H:i:s', time() - DAY_IN_SECONDS, true ), - '{yesterday:format:Y-m-d}' => date_i18n( 'Y-m-d', time() - DAY_IN_SECONDS, true ), - '{yesterday:timestamp}' => time() - DAY_IN_SECONDS, - ); - - foreach ( $tests as $merge_tag => $expected ) { - $this->assertEquals( $expected, GravityView_Merge_Tags::replace_variables( $merge_tag, $form, $entry ), $merge_tag ); + ] ); + + $test_data = [ + '{now:raw}' => date_i18n( 'Y-m-d H:i:s', time(), true ), + '{now:format:Y-m-d}' => date_i18n( 'Y-m-d', time(), true ), + '{now:timestamp}' => time(), + '{tomorrow:raw}' => date_i18n( 'Y-m-d H:i:s', time() + DAY_IN_SECONDS, true ), + '{tomorrow:format:Y-m-d}' => date_i18n( 'Y-m-d', time() + DAY_IN_SECONDS, true ), + '{tomorrow:timestamp}' => time() + DAY_IN_SECONDS, + '{yesterday:raw}' => date_i18n( 'Y-m-d H:i:s', time() - DAY_IN_SECONDS, true ), + '{yesterday:format:Y-m-d}' => date_i18n( 'Y-m-d', time() - DAY_IN_SECONDS, true ), + '{yesterday:timestamp}' => time() - DAY_IN_SECONDS, + ]; + + foreach ( $test_data as $merge_tag => $expected ) { + $this->assertEquals( + $expected, + GravityView_Merge_Tags::replace_variables( $merge_tag, $form, $entry ), + $merge_tag + ); } - } - /** * @covers GravityView_Field::replace_merge_tag * @covers GravityView_Merge_Tags::replace_is_starred From c8ccfc6e29e330be6a726a364d057c6de2315709 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 2 Oct 2024 11:05:46 -0400 Subject: [PATCH 17/37] Update changelog [ci skip] --- includes/class-gravityview-merge-tags.php | 2 +- readme.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/class-gravityview-merge-tags.php b/includes/class-gravityview-merge-tags.php index 9783215c65..5722b0f14a 100644 --- a/includes/class-gravityview-merge-tags.php +++ b/includes/class-gravityview-merge-tags.php @@ -503,7 +503,7 @@ public static function replace_gv_merge_tags( $text, $form = array(), $entry = a } /** - * Replaces human-readable date merge tags with formatted dates per the modifier. + * Replaces relative date merge tags with formatted dates per the modifier. * * @since TBD * diff --git a/readme.txt b/readme.txt index 662c967787..06df2cbcca 100644 --- a/readme.txt +++ b/readme.txt @@ -21,6 +21,10 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h == Changelog == += develop = + +* Added: `{now}`, `{yesterday}` and `{tomorrow}` relative date merge tags. + = 2.29 on October 1, 2024 = This release introduces a much-requested [lightbox feature](https://docs.gravitykit.com/article/1020-opening-and-editing-entry-details-in-a-lightbox-modal-popup) for displaying and editing entries, settings for customizing View URLs, new options for [displaying Name field initials](https://docs.gravitykit.com/article/1021-show-name-fields-as-initials) and Custom Content fields in full width, and a merge tag modifier to show date field values in a human-readable format. Several bugs have also been fixed. From 969e7a4587fb1360317534010d6e00c30182dfd4 Mon Sep 17 00:00:00 2001 From: Vlad Date: Wed, 2 Oct 2024 11:13:16 -0400 Subject: [PATCH 18/37] Update changelog [ci skip] --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 06df2cbcca..aeca185c09 100644 --- a/readme.txt +++ b/readme.txt @@ -24,6 +24,7 @@ Beautifully display your Gravity Forms entries. Learn more on [gravitykit.com](h = develop = * Added: `{now}`, `{yesterday}` and `{tomorrow}` relative date merge tags. +* Improved: Better handling of multi-file uploads on the Edit Entry screen. = 2.29 on October 1, 2024 = From 57bdb1b01d349efcaebc27521ddee46cedcc1c49 Mon Sep 17 00:00:00 2001 From: Doeke Norg Date: Wed, 2 Oct 2024 19:49:24 +0200 Subject: [PATCH 19/37] Require GFExport --- includes/class-gravityview-change-entry-creator.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/includes/class-gravityview-change-entry-creator.php b/includes/class-gravityview-change-entry-creator.php index 58f7348f80..9e5821fcc0 100644 --- a/includes/class-gravityview-change-entry-creator.php +++ b/includes/class-gravityview-change-entry-creator.php @@ -489,6 +489,8 @@ public function register_edit_field( array $fields, array $form, string $zone ): * @return array The updated fields array. */ public function register_created_by_input( array $fields, ?array $editable_fields, array $form ): array { + require_once GFCommon::get_base_path() . '/export.php'; + // Don't add the `created_by` field if the user can't change it. $editable_field_ids = array_flip( array_map( From 0cd996de8b7e9be9e5be1e59a56ba2c32b3e006e Mon Sep 17 00:00:00 2001 From: omarkasem Date: Wed, 2 Oct 2024 21:26:07 +0300 Subject: [PATCH 20/37] Gets choices directly from database to avoid reversal issues --- .../fields/class-gravityview-field-survey.php | 30 +++++++++++++++++++ templates/fields/field-survey-html.php | 8 ++--- 2 files changed, 32 insertions(+), 6 deletions(-) diff --git a/includes/fields/class-gravityview-field-survey.php b/includes/fields/class-gravityview-field-survey.php index 1bb2866000..0a25c6ff0a 100644 --- a/includes/fields/class-gravityview-field-survey.php +++ b/includes/fields/class-gravityview-field-survey.php @@ -59,6 +59,36 @@ public static function get_choice_score( $field, $value, $input_id = 0 ) { return is_array( $value ) ? '' : $value; } + /** + * Get field choices directly from the database (To avoid issues where choices are reversed by the survey plugin). + * + * @since TBD + * + * @param int $form_id The ID of the form. + * @param int $field_id The ID of the field. + * + * @return array The choices for the field. + */ + public static function get_field_choices($form_id, $field_id) { + global $wpdb; + $table_name = GFFormsModel::get_meta_table_name(); + $form_row = $wpdb->get_row( $wpdb->prepare( "SELECT display_meta FROM {$table_name} WHERE form_id=%d", $form_id ), ARRAY_A ); + $form_meta = GFFormsModel::unserialize( rgar( $form_row, 'display_meta' ) ); + + $field_choices = []; + if ( $form_meta ) { + foreach ( $form_meta['fields'] as $form_field ) { + if ( $form_field['id'] == $field_id ) { + $field_choices = $form_field['choices']; + break; + } + } + } + + return $field_choices; + } + + public function field_options( $field_options, $template_id, $field_id, $context, $input_type, $form_id ) { unset( $field_options['search_filter'] ); diff --git a/templates/fields/field-survey-html.php b/templates/fields/field-survey-html.php index 99be953779..f3b52c4321 100644 --- a/templates/fields/field-survey-html.php +++ b/templates/fields/field-survey-html.php @@ -15,6 +15,7 @@ $field = $gravityview->field; $display_value = $gravityview->display_value; $input_id = gravityview_get_input_id_from_id( $field->ID ); +$form_id = $gravityview->view->form->ID; // Used in filters below. $return_true = function () { @@ -142,12 +143,7 @@ return; } - $choices = $field->field->choices; - - // If the choices are reversed, reverse them back. - if ( ! empty( $choices ) && $choices[0]['text'] === 'Excellent' ) { - $choices = array_reverse( $choices ); - } + $choices = GravityView_Field_Survey::get_field_choices( $form_id, $field->ID ); $choice_values = wp_list_pluck( $choices, 'value', $gravityview->value ); $starred_index = array_search( $gravityview->value, $choice_values ); From 70b40ab7e0571d18c1dc379b9b2cb4123aa629a7 Mon Sep 17 00:00:00 2001 From: Vlad Date: Tue, 8 Oct 2024 15:13:44 -0400 Subject: [PATCH 21/37] Enqueue WP scripts during HTML output (#2163) --- .../lightbox-entry/class-gravityview-lightbox-entry.php | 4 +--- readme.txt | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/includes/extensions/lightbox-entry/class-gravityview-lightbox-entry.php b/includes/extensions/lightbox-entry/class-gravityview-lightbox-entry.php index fcba807380..bff8b447ee 100644 --- a/includes/extensions/lightbox-entry/class-gravityview-lightbox-entry.php +++ b/includes/extensions/lightbox-entry/class-gravityview-lightbox-entry.php @@ -464,8 +464,6 @@ private function render_entry( $type, $view, $entry, $form ) { do_action_ref_array( 'wp', [ $wp ] ); - do_action( 'wp_enqueue_scripts' ); - ob_start(); $title = do_shortcode( @@ -487,7 +485,7 @@ private function render_entry( $type, $view, $entry, $form ) { <?php echo $title; ?> - +