From 5d2dc6c329dfa4aed20af87d407ec1a14eca533c Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Thu, 18 Aug 2022 13:24:34 +0300 Subject: [PATCH 1/6] Composer update --- composer.lock | 170 +++++++++++++++++++++++++------------------------- 1 file changed, 85 insertions(+), 85 deletions(-) diff --git a/composer.lock b/composer.lock index 5a664d178..fe7ec706c 100644 --- a/composer.lock +++ b/composer.lock @@ -332,16 +332,16 @@ }, { "name": "donatj/phpuseragentparser", - "version": "v1.6.1", + "version": "v1.7.0", "source": { "type": "git", "url": "https://github.com/donatj/PhpUserAgent.git", - "reference": "264cf23eda626c223d21535584c33794be0ea338" + "reference": "a35900b93530715f8669c10e49756adde5c8e6fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/donatj/PhpUserAgent/zipball/264cf23eda626c223d21535584c33794be0ea338", - "reference": "264cf23eda626c223d21535584c33794be0ea338", + "url": "https://api.github.com/repos/donatj/PhpUserAgent/zipball/a35900b93530715f8669c10e49756adde5c8e6fc", + "reference": "a35900b93530715f8669c10e49756adde5c8e6fc", "shasum": "" }, "require": { @@ -385,7 +385,7 @@ ], "support": { "issues": "https://github.com/donatj/PhpUserAgent/issues", - "source": "https://github.com/donatj/PhpUserAgent/tree/v1.6.1" + "source": "https://github.com/donatj/PhpUserAgent/tree/v1.7.0" }, "funding": [ { @@ -397,7 +397,7 @@ "type": "github" } ], - "time": "2022-06-08T16:36:31+00:00" + "time": "2022-08-06T15:41:58+00:00" }, { "name": "dragonmantank/cron-expression", @@ -841,16 +841,16 @@ }, { "name": "itsgoingd/clockwork", - "version": "v5.1.6", + "version": "v5.1.7", "source": { "type": "git", "url": "https://github.com/itsgoingd/clockwork.git", - "reference": "9df41432da1d8cb39c7fda383ddcc02231c83ff3" + "reference": "2cad6c75dc2b96cbfd48c0511bb035a4e328c17f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/9df41432da1d8cb39c7fda383ddcc02231c83ff3", - "reference": "9df41432da1d8cb39c7fda383ddcc02231c83ff3", + "url": "https://api.github.com/repos/itsgoingd/clockwork/zipball/2cad6c75dc2b96cbfd48c0511bb035a4e328c17f", + "reference": "2cad6c75dc2b96cbfd48c0511bb035a4e328c17f", "shasum": "" }, "require": { @@ -897,7 +897,7 @@ ], "support": { "issues": "https://github.com/itsgoingd/clockwork/issues", - "source": "https://github.com/itsgoingd/clockwork/tree/v5.1.6" + "source": "https://github.com/itsgoingd/clockwork/tree/v5.1.7" }, "funding": [ { @@ -905,7 +905,7 @@ "type": "github" } ], - "time": "2022-04-12T21:35:47+00:00" + "time": "2022-08-14T21:23:22+00:00" }, { "name": "league/climate", @@ -974,16 +974,16 @@ }, { "name": "matthiasmullie/minify", - "version": "1.3.68", + "version": "1.3.69", "source": { "type": "git", "url": "https://github.com/matthiasmullie/minify.git", - "reference": "c00fb02f71b2ef0a5f53fe18c5a8b9aa30f48297" + "reference": "a61c949cccd086808063611ef9698eabe42ef22f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/c00fb02f71b2ef0a5f53fe18c5a8b9aa30f48297", - "reference": "c00fb02f71b2ef0a5f53fe18c5a8b9aa30f48297", + "url": "https://api.github.com/repos/matthiasmullie/minify/zipball/a61c949cccd086808063611ef9698eabe42ef22f", + "reference": "a61c949cccd086808063611ef9698eabe42ef22f", "shasum": "" }, "require": { @@ -1032,7 +1032,7 @@ ], "support": { "issues": "https://github.com/matthiasmullie/minify/issues", - "source": "https://github.com/matthiasmullie/minify/tree/1.3.68" + "source": "https://github.com/matthiasmullie/minify/tree/1.3.69" }, "funding": [ { @@ -1040,7 +1040,7 @@ "type": "github" } ], - "time": "2022-04-19T08:28:56+00:00" + "time": "2022-08-01T09:00:18+00:00" }, { "name": "matthiasmullie/path-converter", @@ -2224,16 +2224,16 @@ }, { "name": "symfony/console", - "version": "v4.4.43", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46" + "reference": "c35fafd7f12ebd6f9e29c95a370df7f1fb171a40" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/8a2628d2d5639f35113dc1b833ecd91e1ed1cf46", - "reference": "8a2628d2d5639f35113dc1b833ecd91e1ed1cf46", + "url": "https://api.github.com/repos/symfony/console/zipball/c35fafd7f12ebd6f9e29c95a370df7f1fb171a40", + "reference": "c35fafd7f12ebd6f9e29c95a370df7f1fb171a40", "shasum": "" }, "require": { @@ -2294,7 +2294,7 @@ "description": "Eases the creation of beautiful and testable command line interfaces", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/console/tree/v4.4.43" + "source": "https://github.com/symfony/console/tree/v4.4.44" }, "funding": [ { @@ -2310,7 +2310,7 @@ "type": "tidelift" } ], - "time": "2022-06-23T12:22:25+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { "name": "symfony/contracts", @@ -2408,16 +2408,16 @@ }, { "name": "symfony/event-dispatcher", - "version": "v4.4.42", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/event-dispatcher.git", - "reference": "708e761740c16b02c86e3f0c932018a06b895d40" + "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/708e761740c16b02c86e3f0c932018a06b895d40", - "reference": "708e761740c16b02c86e3f0c932018a06b895d40", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/1e866e9e5c1b22168e0ce5f0b467f19bba61266a", + "reference": "1e866e9e5c1b22168e0ce5f0b467f19bba61266a", "shasum": "" }, "require": { @@ -2472,7 +2472,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/v4.4.42" + "source": "https://github.com/symfony/event-dispatcher/tree/v4.4.44" }, "funding": [ { @@ -2488,20 +2488,20 @@ "type": "tidelift" } ], - "time": "2022-05-05T15:33:49+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { "name": "symfony/http-client", - "version": "v4.4.42", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/http-client.git", - "reference": "0366fe9d67709477e86b45e2e51a34ccf5018d04" + "reference": "900632460c2ed5fa656b13cb911ff8f702918618" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-client/zipball/0366fe9d67709477e86b45e2e51a34ccf5018d04", - "reference": "0366fe9d67709477e86b45e2e51a34ccf5018d04", + "url": "https://api.github.com/repos/symfony/http-client/zipball/900632460c2ed5fa656b13cb911ff8f702918618", + "reference": "900632460c2ed5fa656b13cb911ff8f702918618", "shasum": "" }, "require": { @@ -2553,7 +2553,7 @@ "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/http-client/tree/v4.4.42" + "source": "https://github.com/symfony/http-client/tree/v4.4.44" }, "funding": [ { @@ -2569,7 +2569,7 @@ "type": "tidelift" } ], - "time": "2022-05-17T14:14:05+00:00" + "time": "2022-07-27T17:16:03+00:00" }, { "name": "symfony/polyfill-ctype", @@ -3063,16 +3063,16 @@ }, { "name": "symfony/process", - "version": "v4.4.41", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/process.git", - "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce" + "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/process/zipball/9eedd60225506d56e42210a70c21bb80ca8456ce", - "reference": "9eedd60225506d56e42210a70c21bb80ca8456ce", + "url": "https://api.github.com/repos/symfony/process/zipball/5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", + "reference": "5cee9cdc4f7805e2699d9fd66991a0e6df8252a2", "shasum": "" }, "require": { @@ -3105,7 +3105,7 @@ "description": "Executes commands in sub-processes", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/process/tree/v4.4.41" + "source": "https://github.com/symfony/process/tree/v4.4.44" }, "funding": [ { @@ -3121,20 +3121,20 @@ "type": "tidelift" } ], - "time": "2022-04-04T10:19:07+00:00" + "time": "2022-06-27T13:16:42+00:00" }, { "name": "symfony/var-dumper", - "version": "v4.4.42", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/var-dumper.git", - "reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca" + "reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/var-dumper/zipball/742aab50ad097bcb62d91fccb613f66b8047d2ca", - "reference": "742aab50ad097bcb62d91fccb613f66b8047d2ca", + "url": "https://api.github.com/repos/symfony/var-dumper/zipball/f19951007dae942cc79b979c1fe26bfdfbeb54ed", + "reference": "f19951007dae942cc79b979c1fe26bfdfbeb54ed", "shasum": "" }, "require": { @@ -3194,7 +3194,7 @@ "dump" ], "support": { - "source": "https://github.com/symfony/var-dumper/tree/v4.4.42" + "source": "https://github.com/symfony/var-dumper/tree/v4.4.44" }, "funding": [ { @@ -3210,20 +3210,20 @@ "type": "tidelift" } ], - "time": "2022-05-21T10:00:54+00:00" + "time": "2022-07-20T09:59:04+00:00" }, { "name": "symfony/yaml", - "version": "v4.4.43", + "version": "v4.4.44", "source": { "type": "git", "url": "https://github.com/symfony/yaml.git", - "reference": "07e392f0ef78376d080d5353c081a5e5704835bd" + "reference": "c2b28c10fb3b7ac67bafa7b8f952cd83f35acde2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/07e392f0ef78376d080d5353c081a5e5704835bd", - "reference": "07e392f0ef78376d080d5353c081a5e5704835bd", + "url": "https://api.github.com/repos/symfony/yaml/zipball/c2b28c10fb3b7ac67bafa7b8f952cd83f35acde2", + "reference": "c2b28c10fb3b7ac67bafa7b8f952cd83f35acde2", "shasum": "" }, "require": { @@ -3265,7 +3265,7 @@ "description": "Loads and dumps YAML files", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/yaml/tree/v4.4.43" + "source": "https://github.com/symfony/yaml/tree/v4.4.44" }, "funding": [ { @@ -3281,7 +3281,7 @@ "type": "tidelift" } ], - "time": "2022-06-20T08:31:17+00:00" + "time": "2022-06-27T13:16:42+00:00" }, { "name": "twig/twig", @@ -3484,16 +3484,16 @@ }, { "name": "codeception/codeception", - "version": "4.2.1", + "version": "4.2.2", "source": { "type": "git", "url": "https://github.com/Codeception/Codeception.git", - "reference": "77b3e2003fd4446b35826cb9dc397129c521c888" + "reference": "b88014f3348c93f3df99dc6d0967b0dbfa804474" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Codeception/Codeception/zipball/77b3e2003fd4446b35826cb9dc397129c521c888", - "reference": "77b3e2003fd4446b35826cb9dc397129c521c888", + "url": "https://api.github.com/repos/Codeception/Codeception/zipball/b88014f3348c93f3df99dc6d0967b0dbfa804474", + "reference": "b88014f3348c93f3df99dc6d0967b0dbfa804474", "shasum": "" }, "require": { @@ -3570,7 +3570,7 @@ ], "support": { "issues": "https://github.com/Codeception/Codeception/issues", - "source": "https://github.com/Codeception/Codeception/tree/4.2.1" + "source": "https://github.com/Codeception/Codeception/tree/4.2.2" }, "funding": [ { @@ -3578,7 +3578,7 @@ "type": "open_collective" } ], - "time": "2022-06-22T06:18:59+00:00" + "time": "2022-08-13T13:28:25+00:00" }, { "name": "codeception/lib-asserts", @@ -6224,16 +6224,16 @@ }, { "name": "symfony/browser-kit", - "version": "v5.4.3", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/browser-kit.git", - "reference": "18e73179c6a33d520de1b644941eba108dd811ad" + "reference": "081fe28a26b6bd671dea85ef3a4b5003f3c88027" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/browser-kit/zipball/18e73179c6a33d520de1b644941eba108dd811ad", - "reference": "18e73179c6a33d520de1b644941eba108dd811ad", + "url": "https://api.github.com/repos/symfony/browser-kit/zipball/081fe28a26b6bd671dea85ef3a4b5003f3c88027", + "reference": "081fe28a26b6bd671dea85ef3a4b5003f3c88027", "shasum": "" }, "require": { @@ -6276,7 +6276,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.3" + "source": "https://github.com/symfony/browser-kit/tree/v5.4.11" }, "funding": [ { @@ -6292,20 +6292,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-07-27T15:50:05+00:00" }, { "name": "symfony/css-selector", - "version": "v5.4.3", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/css-selector.git", - "reference": "b0a190285cd95cb019237851205b8140ef6e368e" + "reference": "c1681789f059ab756001052164726ae88512ae3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/css-selector/zipball/b0a190285cd95cb019237851205b8140ef6e368e", - "reference": "b0a190285cd95cb019237851205b8140ef6e368e", + "url": "https://api.github.com/repos/symfony/css-selector/zipball/c1681789f059ab756001052164726ae88512ae3d", + "reference": "c1681789f059ab756001052164726ae88512ae3d", "shasum": "" }, "require": { @@ -6342,7 +6342,7 @@ "description": "Converts CSS selectors to XPath expressions", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/css-selector/tree/v5.4.3" + "source": "https://github.com/symfony/css-selector/tree/v5.4.11" }, "funding": [ { @@ -6358,7 +6358,7 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2022-06-27T16:58:25+00:00" }, { "name": "symfony/deprecation-contracts", @@ -6429,16 +6429,16 @@ }, { "name": "symfony/dom-crawler", - "version": "v5.4.9", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/dom-crawler.git", - "reference": "a213cbc80382320b0efdccdcdce232f191fafe3a" + "reference": "0b900ca5576ecd59e08c76127e616667cfe427a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/a213cbc80382320b0efdccdcdce232f191fafe3a", - "reference": "a213cbc80382320b0efdccdcdce232f191fafe3a", + "url": "https://api.github.com/repos/symfony/dom-crawler/zipball/0b900ca5576ecd59e08c76127e616667cfe427a7", + "reference": "0b900ca5576ecd59e08c76127e616667cfe427a7", "shasum": "" }, "require": { @@ -6484,7 +6484,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.9" + "source": "https://github.com/symfony/dom-crawler/tree/v5.4.11" }, "funding": [ { @@ -6500,20 +6500,20 @@ "type": "tidelift" } ], - "time": "2022-05-04T14:46:32+00:00" + "time": "2022-06-27T16:58:25+00:00" }, { "name": "symfony/finder", - "version": "v5.4.8", + "version": "v5.4.11", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9" + "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/9b630f3427f3ebe7cd346c277a1408b00249dad9", - "reference": "9b630f3427f3ebe7cd346c277a1408b00249dad9", + "url": "https://api.github.com/repos/symfony/finder/zipball/7872a66f57caffa2916a584db1aa7f12adc76f8c", + "reference": "7872a66f57caffa2916a584db1aa7f12adc76f8c", "shasum": "" }, "require": { @@ -6547,7 +6547,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.8" + "source": "https://github.com/symfony/finder/tree/v5.4.11" }, "funding": [ { @@ -6563,7 +6563,7 @@ "type": "tidelift" } ], - "time": "2022-04-15T08:07:45+00:00" + "time": "2022-07-29T07:37:50+00:00" }, { "name": "theseer/tokenizer", @@ -6692,5 +6692,5 @@ "platform-overrides": { "php": "7.3.6" }, - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.2.0" } From 6882037b85419a1d303232a1f168d7ceb8eb4299 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 2 Sep 2022 13:11:48 +0300 Subject: [PATCH 2/6] Added `authorize-*@:` support for Flex blueprints --- CHANGELOG.md | 6 ++++ .../src/Grav/Framework/Flex/FlexDirectory.php | 31 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0958fe451..56f93123b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# v1.7.36 +## mm/dd/2022 + +1. [](#new) + * Added `authorize-*@:` support for Flex blueprints, e.g. `authorize-disabled@: not delete` disables the field if user does not have access to delete objec + # v1.7.35 ## 08/04/2022 diff --git a/system/src/Grav/Framework/Flex/FlexDirectory.php b/system/src/Grav/Framework/Flex/FlexDirectory.php index dce8bf523..5368ebce0 100644 --- a/system/src/Grav/Framework/Flex/FlexDirectory.php +++ b/system/src/Grav/Framework/Flex/FlexDirectory.php @@ -836,6 +836,9 @@ class FlexDirectory implements FlexDirectoryInterface $blueprint->addDynamicHandler('flex', function (array &$field, $property, array &$call) { $this->dynamicFlexField($field, $property, $call); }); + $blueprint->addDynamicHandler('authorize', function (array &$field, $property, array &$call) { + $this->dynamicAuthorizeField($field, $property, $call); + }); if ($context) { $blueprint->setContext($context); @@ -921,6 +924,34 @@ class FlexDirectory implements FlexDirectoryInterface } } + /** + * @param array $field + * @param string $property + * @param array $call + * @return void + */ + protected function dynamicAuthorizeField(array &$field, $property, array $call): void + { + $params = (array)$call['params']; + $object = $call['object'] ?? null; + $permission = array_shift($params); + $not = false; + if (str_starts_with($permission, '!')) { + $permission = substr($permission, 1); + $not = true; + } elseif (str_starts_with($permission, 'not ')) { + $permission = substr($permission, 4); + $not = true; + } + $permission = trim($permission); + + if ($object) { + $value = $object->isAuthorized($permission) ?? false; + + $field[$property] = $not ? !$value : $value; + } + } + /** * @param array $array1 * @param array $array2 From dbca0b451cb9a8b8219d321c81c194db42baf552 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 2 Sep 2022 19:02:32 +0300 Subject: [PATCH 3/6] Typo --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 56f93123b..51205cd76 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ ## mm/dd/2022 1. [](#new) - * Added `authorize-*@:` support for Flex blueprints, e.g. `authorize-disabled@: not delete` disables the field if user does not have access to delete objec + * Added `authorize-*@:` support for Flex blueprints, e.g. `authorize-disabled@: not delete` disables the field if user does not have access to delete object # v1.7.35 ## 08/04/2022 From 3f10c058409c8c175f47958cf3489ed32b840ba0 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Fri, 2 Sep 2022 19:36:22 +0300 Subject: [PATCH 4/6] Added support for `flex-ignore@` to hide all the nested fields in the blueprint --- CHANGELOG.md | 1 + system/src/Grav/Common/Data/Blueprint.php | 8 ++++---- system/src/Grav/Framework/Flex/FlexDirectory.php | 8 +++++++- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51205cd76..86e137c8e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ 1. [](#new) * Added `authorize-*@:` support for Flex blueprints, e.g. `authorize-disabled@: not delete` disables the field if user does not have access to delete object + * Added support for `flex-ignore@` to hide all the nested fields in the blueprint # v1.7.35 ## 08/04/2022 diff --git a/system/src/Grav/Common/Data/Blueprint.php b/system/src/Grav/Common/Data/Blueprint.php index ef6aef50d..906fd7917 100644 --- a/system/src/Grav/Common/Data/Blueprint.php +++ b/system/src/Grav/Common/Data/Blueprint.php @@ -515,7 +515,7 @@ class Blueprint extends BlueprintForm $success = $this->resolveActions($user, $actions); } if (!$success) { - $this->addPropertyRecursive($field, 'validate', ['ignore' => true]); + static::addPropertyRecursive($field, 'validate', ['ignore' => true]); } } @@ -566,7 +566,7 @@ class Blueprint extends BlueprintForm } if ($matches) { - $this->addPropertyRecursive($field, 'validate', ['ignore' => true]); + static::addPropertyRecursive($field, 'validate', ['ignore' => true]); return; } } @@ -577,7 +577,7 @@ class Blueprint extends BlueprintForm * @param mixed $value * @return void */ - protected function addPropertyRecursive(array &$field, $property, $value) + public static function addPropertyRecursive(array &$field, $property, $value) { if (is_array($value) && isset($field[$property]) && is_array($field[$property])) { $field[$property] = array_merge_recursive($field[$property], $value); @@ -587,7 +587,7 @@ class Blueprint extends BlueprintForm if (!empty($field['fields'])) { foreach ($field['fields'] as $key => &$child) { - $this->addPropertyRecursive($child, $property, $value); + static::addPropertyRecursive($child, $property, $value); } } } diff --git a/system/src/Grav/Framework/Flex/FlexDirectory.php b/system/src/Grav/Framework/Flex/FlexDirectory.php index 5368ebce0..7197284e0 100644 --- a/system/src/Grav/Framework/Flex/FlexDirectory.php +++ b/system/src/Grav/Framework/Flex/FlexDirectory.php @@ -920,7 +920,13 @@ class FlexDirectory implements FlexDirectoryInterface if (is_array($value) && isset($field[$property]) && is_array($field[$property])) { $value = $this->mergeArrays($field[$property], $value); } - $field[$property] = $not ? !$value : $value; + $value = $not ? !$value : $value; + + if ($property === 'ignore' && $value) { + Blueprint::addPropertyRecursive($field, 'validate', ['ignore' => true]); + } else { + $field[$property] = $value; + } } } From f799a710018cea231a13db8cee113a9e3ac3c205 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Mon, 5 Sep 2022 21:14:37 +0300 Subject: [PATCH 5/6] Fixed loggin with a capitalised email address when using old users [getgrav/grav-plugin-login#229] --- CHANGELOG.md | 2 ++ system/src/Grav/Common/User/DataUser/UserCollection.php | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86e137c8e..a936561bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ 1. [](#new) * Added `authorize-*@:` support for Flex blueprints, e.g. `authorize-disabled@: not delete` disables the field if user does not have access to delete object * Added support for `flex-ignore@` to hide all the nested fields in the blueprint +1. [](#bugfix) + * Fixed loggin with a capitalised email address when using old users [getgrav/grav-plugin-login#229](https://github.com/getgrav/grav-plugin-login/issues/229) # v1.7.35 ## 08/04/2022 diff --git a/system/src/Grav/Common/User/DataUser/UserCollection.php b/system/src/Grav/Common/User/DataUser/UserCollection.php index d0ada09c9..c997bdc44 100644 --- a/system/src/Grav/Common/User/DataUser/UserCollection.php +++ b/system/src/Grav/Common/User/DataUser/UserCollection.php @@ -112,11 +112,12 @@ class UserCollection implements UserCollectionInterface // If not found, try the fields if (!$user->exists()) { + $query = mb_strtolower($query); foreach ($files as $file) { if (Utils::endsWith($file, YAML_EXT)) { $find_user = $this->load(trim(Utils::pathinfo($file, PATHINFO_FILENAME))); foreach ($fields as $field) { - if (isset($find_user[$field]) && $find_user[$field] === $query) { + if (isset($find_user[$field]) && mb_strtolower($find_user[$field]) === $query) { return $find_user; } } From 840862c26da32cbdd94a90ffec2e7dcb6c391a56 Mon Sep 17 00:00:00 2001 From: Andy Miller Date: Thu, 8 Sep 2022 11:59:44 -0600 Subject: [PATCH 6/6] prepare for release --- CHANGELOG.md | 2 +- system/defines.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a936561bb..d5ecdee9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,5 @@ # v1.7.36 -## mm/dd/2022 +## 09/08/2022 1. [](#new) * Added `authorize-*@:` support for Flex blueprints, e.g. `authorize-disabled@: not delete` disables the field if user does not have access to delete object diff --git a/system/defines.php b/system/defines.php index 2e4853cf6..ca967d29e 100644 --- a/system/defines.php +++ b/system/defines.php @@ -9,7 +9,7 @@ // Some standard defines define('GRAV', true); -define('GRAV_VERSION', '1.7.35'); +define('GRAV_VERSION', '1.7.36'); define('GRAV_SCHEMA', '1.7.0_2020-11-20_1'); define('GRAV_TESTING', false);