From 6e9e0f52281a0eb08eec530a39db0f6b869eb1bc Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Mon, 9 Dec 2024 14:32:19 +0100 Subject: [PATCH 1/2] [BUGFIX] Rename property in database to serialized_cart Relates: #600 --- Classes/Domain/Model/Cart.php | 6 +++--- Configuration/TCA/tx_cart_domain_model_cart.php | 6 +++--- ext_tables.sql | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Classes/Domain/Model/Cart.php b/Classes/Domain/Model/Cart.php index 46d7b850..23f17af9 100644 --- a/Classes/Domain/Model/Cart.php +++ b/Classes/Domain/Model/Cart.php @@ -24,7 +24,7 @@ class Cart extends AbstractEntity protected ?Item $orderItem = null; - protected ?string $cart = null; + protected ?string $serializedCart = null; protected bool $wasOrdered = false; @@ -66,12 +66,12 @@ public function setOrderItem(Item $orderItem): void public function getCart(): ?Cart\Cart { - return unserialize($this->cart); + return unserialize($this->serializedCart); } public function setCart(Cart\Cart $cart): void { - $this->cart = serialize($cart); + $this->serializedCart = serialize($cart); } /** diff --git a/Configuration/TCA/tx_cart_domain_model_cart.php b/Configuration/TCA/tx_cart_domain_model_cart.php index 4762e662..72d425c8 100644 --- a/Configuration/TCA/tx_cart_domain_model_cart.php +++ b/Configuration/TCA/tx_cart_domain_model_cart.php @@ -22,7 +22,7 @@ 'types' => [ '1' => [ 'showitem' => - 'pid, f_hash, s_hash, fe_user, was_ordered, order_item, cart', + 'pid, f_hash, s_hash, fe_user, was_ordered, order_item, serialized_cart', ], ], 'palettes' => [ @@ -90,9 +90,9 @@ 'maxitems' => 1, ], ], - 'cart' => [ + 'serialized_cart' => [ 'exclude' => 0, - 'label' => $_LLL . ':tx_cart_domain_model_cart.cart', + 'label' => $_LLL . ':tx_cart_domain_model_cart.serialized_cart', 'config' => [ 'type' => 'text', 'cols' => 48, diff --git a/ext_tables.sql b/ext_tables.sql index f471d885..acc70928 100644 --- a/ext_tables.sql +++ b/ext_tables.sql @@ -251,7 +251,7 @@ CREATE TABLE tx_cart_domain_model_cart ( order_item int(11) unsigned DEFAULT '0' NOT NULL, - cart text, + serialized_cart text, was_ordered tinyint(4) unsigned DEFAULT '0' NOT NULL, From 3d66cb6f285aabec413b619bbe7490ffe1fe20fe Mon Sep 17 00:00:00 2001 From: Daniel Gohlke Date: Mon, 9 Dec 2024 14:55:36 +0100 Subject: [PATCH 2/2] [BUGFIX] Add blank line after opening tag --- Build/UnitTestsBootstrap.php | 1 + 1 file changed, 1 insertion(+) diff --git a/Build/UnitTestsBootstrap.php b/Build/UnitTestsBootstrap.php index 5b5bbd00..d2cd5570 100644 --- a/Build/UnitTestsBootstrap.php +++ b/Build/UnitTestsBootstrap.php @@ -1,4 +1,5 @@