From e98f0d45af1f3684748a1a49d47d0f91f2bc0225 Mon Sep 17 00:00:00 2001 From: Bernard Hamlin <948122+blueo@users.noreply.github.com> Date: Thu, 25 May 2023 11:42:43 +1200 Subject: [PATCH 1/2] Use ::create instead of new in GridFieldDetailForm_ItemRequest (#10791) Updates instances of `new X` to `X::create` so that Silverstripe classes will respect dependency injection --- .../GridField/GridFieldDetailForm_ItemRequest.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php index 1191cc99d..f08ee32b6 100644 --- a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php +++ b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php @@ -137,7 +137,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler $form = $this->ItemEditForm(); $form->makeReadonly(); - $data = new ArrayData([ + $data = ArrayData::create([ 'Backlink' => $controller->Link(), 'ItemEditForm' => $form ]); @@ -235,7 +235,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler } } - $form = new Form( + $form = Form::create( $this, 'ItemEditForm', $fields, @@ -434,7 +434,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler $oneLevelUp->Link, // url _t('SilverStripe\\Forms\\GridField\\GridFieldDetailForm.CancelBtn', 'Cancel') // label ); - $actions->insertAfter('MajorActions', new LiteralField('cancelbutton', $text)); + $actions->insertAfter('MajorActions', LiteralField::create('cancelbutton', $text)); } } @@ -879,17 +879,17 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler $items = $this->popupController->Breadcrumbs($unlinked); if (!$items) { - $items = new ArrayList(); + $items = ArrayList::create(); } if ($this->record && $this->record->ID) { $title = ($this->record->Title) ? $this->record->Title : "#{$this->record->ID}"; - $items->push(new ArrayData([ + $items->push(ArrayData::create([ 'Title' => $title, 'Link' => $this->Link() ])); } else { - $items->push(new ArrayData([ + $items->push(ArrayData::create([ 'Title' => _t('SilverStripe\\Forms\\GridField\\GridField.NewRecord', 'New {type}', ['type' => $this->record->i18n_singular_name()]), 'Link' => false ])); From 6b49b6cdb68d70d00f9fe0bce038095db539e577 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 30 May 2023 15:30:32 +1200 Subject: [PATCH 2/2] ENH Update translations --- lang/eo.yml | 3 +++ lang/nl.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/lang/eo.yml b/lang/eo.yml index 0a65dc04e..f604c0fe8 100644 --- a/lang/eo.yml +++ b/lang/eo.yml @@ -369,3 +369,6 @@ eo: PASSWORDRESETSENTTEXT: 'Dankon. Reagorda ligilo sendiĝis, kondiĉe ke konto ekzistas por ĉi tiu retadreso.' SilverStripe\View\Shortcodes\EmbedShortcodeProvider: INVALID_URL: 'Okazis problemo ŝargi la aŭdvidaĵon.' + DataObject: + php: + SilverStripe\ORM\DataObjectGENERALSEARCH: 'Ĝenerala serĉo' diff --git a/lang/nl.yml b/lang/nl.yml index d0fb5a4be..2fc503fd2 100644 --- a/lang/nl.yml +++ b/lang/nl.yml @@ -369,3 +369,6 @@ nl: PASSWORDRESETSENTTEXT: 'Bedankt! Er is een e-mail verstuurd om je wachtwoord opnieuw in te stellen - mits het e-mailadres reeds bekend is bij ons.' SilverStripe\View\Shortcodes\EmbedShortcodeProvider: INVALID_URL: 'Het inladen van de media-bestanden is mislukt.' + DataObject: + php: + SilverStripe\ORM\DataObjectGENERALSEARCH: 'Alles doorzoeken'