From e57ed008dfc44ad69a6aa1105bd9a86c29d7eea8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 21:36:49 +1300 Subject: [PATCH 1/4] Bump cross-spawn from 7.0.3 to 7.0.6 (#1513) Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 61372a4b1..48a857785 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3129,9 +3129,9 @@ create-react-class@^15.7.0: object-assign "^4.1.1" cross-spawn@^7.0.2, cross-spawn@^7.0.3: - version "7.0.3" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" - integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + version "7.0.6" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f" + integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA== dependencies: path-key "^3.1.0" shebang-command "^2.0.0" From 14c8221fc7f8962351cb0ae3034bd2f4d3379ec3 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Thu, 5 Dec 2024 17:32:00 +1300 Subject: [PATCH 2/4] API Rename validator classes --- code/Forms/AssetFormFactory.php | 6 +++--- code/Forms/FileFormFactory.php | 4 ++-- code/Forms/RemoteFileFormFactory.php | 4 ++-- code/Forms/UploadField.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/code/Forms/AssetFormFactory.php b/code/Forms/AssetFormFactory.php index 13b2e55a7..390203f5d 100644 --- a/code/Forms/AssetFormFactory.php +++ b/code/Forms/AssetFormFactory.php @@ -21,7 +21,7 @@ use SilverStripe\Forms\OptionsetField; use SilverStripe\Forms\PopoverField; use SilverStripe\Forms\ReadonlyField; -use SilverStripe\Forms\RequiredFields; +use SilverStripe\Forms\Validation\RequiredFieldsValidator; use SilverStripe\Forms\Tab; use SilverStripe\Forms\TabSet; use SilverStripe\Forms\TextField; @@ -108,11 +108,11 @@ public function getForm(?RequestHandler $controller = null, $name = FormFactory: * @param RequestHandler $controller * @param $formName * @param $context - * @return RequiredFields + * @return RequiredFieldsValidator */ protected function getValidator(?RequestHandler $controller, $formName, $context = []) { - $validator = new RequiredFields('Name'); + $validator = new RequiredFieldsValidator('Name'); return $validator; } diff --git a/code/Forms/FileFormFactory.php b/code/Forms/FileFormFactory.php index 57bee0abe..a25a2d9e7 100644 --- a/code/Forms/FileFormFactory.php +++ b/code/Forms/FileFormFactory.php @@ -13,7 +13,7 @@ use SilverStripe\Forms\HeaderField; use SilverStripe\Forms\HiddenField; use SilverStripe\Forms\LiteralField; -use SilverStripe\Forms\RequiredFields; +use SilverStripe\Forms\Validation\RequiredFieldsValidator; use SilverStripe\Forms\Tab; use SilverStripe\Forms\TabSet; use SilverStripe\Forms\TextField; @@ -503,7 +503,7 @@ public function getRequiredContext() * @param RequestHandler $controller * @param $formName * @param $context - * @return RequiredFields + * @return RequiredFieldsValidator */ protected function getValidator(?RequestHandler $controller, $formName, $context = []) { diff --git a/code/Forms/RemoteFileFormFactory.php b/code/Forms/RemoteFileFormFactory.php index f44590111..fbf2f73e0 100644 --- a/code/Forms/RemoteFileFormFactory.php +++ b/code/Forms/RemoteFileFormFactory.php @@ -18,7 +18,7 @@ use SilverStripe\Forms\HiddenField; use SilverStripe\Forms\LiteralField; use SilverStripe\Forms\OptionsetField; -use SilverStripe\Forms\RequiredFields; +use SilverStripe\Forms\Validation\RequiredFieldsValidator; use SilverStripe\Forms\TextField; use SilverStripe\View\Embed\Embeddable; @@ -109,7 +109,7 @@ public function getForm(?RequestHandler $controller = null, $name = RemoteFileFo $fields = $this->getFormFields($controller, $name, $context); $actions = $this->getFormActions($controller, $name, $context); - $validator = new RequiredFields(); + $validator = new RequiredFieldsValidator(); $form = Form::create($controller, $name, $fields, $actions, $validator); $form->addExtraClass('form--fill-height'); $form->addExtraClass('form--no-dividers'); diff --git a/code/Forms/UploadField.php b/code/Forms/UploadField.php index 6919fc9f6..26a23e9ec 100644 --- a/code/Forms/UploadField.php +++ b/code/Forms/UploadField.php @@ -11,7 +11,7 @@ use SilverStripe\Forms\FileHandleField; use SilverStripe\Forms\FileUploadReceiver; use SilverStripe\Forms\FormField; -use SilverStripe\Forms\Validator; +use SilverStripe\Forms\Validation\Validator; use SilverStripe\ORM\DataObject; use SilverStripe\Model\List\SS_List; From 1563dbfaf82d4e1a2046e2eaaafcf2cc47456450 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Wed, 11 Dec 2024 15:40:38 +1300 Subject: [PATCH 3/4] ENH Do not pass in redundant validator --- code/Forms/RemoteFileFormFactory.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/Forms/RemoteFileFormFactory.php b/code/Forms/RemoteFileFormFactory.php index fbf2f73e0..78c22e2e6 100644 --- a/code/Forms/RemoteFileFormFactory.php +++ b/code/Forms/RemoteFileFormFactory.php @@ -109,8 +109,7 @@ public function getForm(?RequestHandler $controller = null, $name = RemoteFileFo $fields = $this->getFormFields($controller, $name, $context); $actions = $this->getFormActions($controller, $name, $context); - $validator = new RequiredFieldsValidator(); - $form = Form::create($controller, $name, $fields, $actions, $validator); + $form = Form::create($controller, $name, $fields, $actions); $form->addExtraClass('form--fill-height'); $form->addExtraClass('form--no-dividers'); $form->addExtraClass('insert-embed-modal--'. strtolower($context['type'] ?? '')); From fddb6295f61c5ae4d3919d994de19a61140cae29 Mon Sep 17 00:00:00 2001 From: Guy Sartorelli <36352093+GuySartorelli@users.noreply.github.com> Date: Thu, 12 Dec 2024 17:28:56 +1300 Subject: [PATCH 4/4] ENH Update code to reflect changes to silverstripe/admin (#1520) --- code/Controller/AssetAdmin.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/Controller/AssetAdmin.php b/code/Controller/AssetAdmin.php index 7714fc4ff..fdf5370da 100644 --- a/code/Controller/AssetAdmin.php +++ b/code/Controller/AssetAdmin.php @@ -819,10 +819,10 @@ public function providePermissions() { return array( "CMS_ACCESS_AssetAdmin" => array( - 'name' => _t('SilverStripe\\CMS\\Controllers\\CMSMain.ACCESS', "Access to '{title}' section", array( + 'name' => _t(LeftAndMain::class . '.ACCESS', "Access to '{title}' section", array( 'title' => static::menu_title() )), - 'category' => _t('SilverStripe\\Security\\Permission.CMS_ACCESS_CATEGORY', 'CMS Access') + 'category' => _t(LeftAndMain::class . '.CMS_ACCESS_CATEGORY', 'CMS Access') ) ); }