Skip to content

Commit

Permalink
Merge pull request #601 from extcode/600-extbase-tries-to-map-seriali…
Browse files Browse the repository at this point in the history
…zed-cart-from-database

[BUGFIX] Rename property in database to serialized_cart
  • Loading branch information
extcode authored Dec 9, 2024
2 parents dd50fd8 + 855de5d commit 41c87cd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions Build/UnitTestsBootstrap.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/*
* This file is part of the TYPO3 CMS project.
*
Expand Down
6 changes: 3 additions & 3 deletions Classes/Domain/Model/Cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class Cart extends AbstractEntity

protected ?Item $orderItem = null;

protected ?string $cart = null;
protected ?string $serializedCart = null;

protected bool $wasOrdered = false;

Expand Down Expand Up @@ -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);
}

/**
Expand Down
6 changes: 3 additions & 3 deletions Configuration/TCA/tx_cart_domain_model_cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -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' => [
Expand Down Expand Up @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion ext_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Expand Down

0 comments on commit 41c87cd

Please sign in to comment.