From c21570757a3f38431471ebafd8c72c9f71c69e91 Mon Sep 17 00:00:00 2001 From: Martina Lindenhofer <68067510+MLindenhofer@users.noreply.github.com> Date: Wed, 18 Oct 2023 16:31:00 +0200 Subject: [PATCH 1/3] Fix bug with sorting ProductVariations * Update CartForm.php add $removecount and $updatecount to extension point to make it possible to create session messages in singular form * Remove sort method call with RAW SQL from ProductVariationsExtension.php as it is no longer supported in CMS5. Add sort call to getFormFields-Method in VariationForm.php * Update VariationForm.php Change notation of sort-params to more readable array notation --- src/Extension/ProductVariationsExtension.php | 4 ++-- src/Forms/VariationForm.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Extension/ProductVariationsExtension.php b/src/Extension/ProductVariationsExtension.php index 3a663b64..90061118 100644 --- a/src/Extension/ProductVariationsExtension.php +++ b/src/Extension/ProductVariationsExtension.php @@ -57,7 +57,7 @@ public function updateCMSFields(FieldList $fields) GridFieldConfig_RecordEditor::create(100) ) ]); - + $variationsGridField->getConfig()->addComponent($sort = new GridFieldOrderableRows('Sort')); if ($this->owner->Variations()->exists()) { @@ -210,7 +210,7 @@ public function possibleValuesForAttributeType($type) '"SilverShop_Variation_AttributeValues"."SilverShop_VariationID" = "SilverShop_Variation"."ID"' )->where( "TypeID = $type AND \"SilverShop_Variation\".\"ProductID\" = " . $this->owner->ID - )->sort('"SilverShop_Variation"."Sort" ASC'); + ); if (!Product::config()->allow_zero_price) { $list = $list->where('"SilverShop_Variation"."Price" > 0'); diff --git a/src/Forms/VariationForm.php b/src/Forms/VariationForm.php index c3079aae..969a7215 100644 --- a/src/Forms/VariationForm.php +++ b/src/Forms/VariationForm.php @@ -130,7 +130,7 @@ protected function getFormFields($controller = null) '', ['attribute' => $attribute->Label] ), - $product->possibleValuesForAttributeType($attribute) + $product->possibleValuesForAttributeType($attribute)->sort(['Sort' => 'ASC']) ); if ($attributeDropdown) { From 4fa2c53739b715b76f185fe304f55902828179fd Mon Sep 17 00:00:00 2001 From: Martina Lindenhofer <68067510+MLindenhofer@users.noreply.github.com> Date: Wed, 18 Oct 2023 20:51:39 +0200 Subject: [PATCH 2/3] AdressBook Update: add address type to newaddress-option (#792) --- src/Checkout/Component/AddressBook.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Checkout/Component/AddressBook.php b/src/Checkout/Component/AddressBook.php index 90b76b5a..3915f774 100644 --- a/src/Checkout/Component/AddressBook.php +++ b/src/Checkout/Component/AddressBook.php @@ -72,7 +72,7 @@ public function getExistingAddressFields() $member = Security::getCurrentUser(); if ($member && $member->AddressBook()->exists()) { $addressoptions = $member->AddressBook()->sort('Created', 'DESC')->map('ID', 'toString')->toArray(); - $addressoptions['newaddress'] = _t('SilverShop\Model\Address.CreateNewAddress', 'Create new address'); + $addressoptions['newaddress'] = _t('SilverShop\Model\Address.CreateNewAddress', 'Create new {AddressType} address', '', ["AddressType" => $this->addresstype]); $fieldtype = count($addressoptions) > 3 ? DropdownField::class : OptionsetField::class; $label = _t("SilverShop\Model\Address.Existing{$this->addresstype}Address", "Existing {$this->addresstype} Address"); From 2309115f785fd4f5f24b6f1620ac7248fc78b252 Mon Sep 17 00:00:00 2001 From: wernerkrauss Date: Wed, 18 Oct 2023 21:56:48 +0200 Subject: [PATCH 3/3] CI: omnipay doesn't have a master branch any more (#795) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0330d2db..54a8d00c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,5 +12,5 @@ jobs: with: composer_require_extra: phpunit/phpunit:^9.5 - silverstripe/silverstripe-omnipay:dev-master + silverstripe/silverstripe-omnipay:dev-main php-http/discovery:^1.18.1