From 3baf789b98a5f910f2150582c87af3852ea9759b Mon Sep 17 00:00:00 2001 From: Hotlander Date: Wed, 17 Jun 2020 15:59:10 +0200 Subject: [PATCH] - fixed issue with Migration where it was trying to create the order table on updating the application while it already exists - fixed issue with association name in the Enum field being inconsistent between the installer and the migration - Added additional enum options such as Box and Pallet --- .../Doctrine/OrderItemProductUnitListener.php | 5 ++--- .../Migrations/Schema/v1_12/MarelloOrderBundle.php | 4 ++-- .../Migrations/Data/ORM/LoadProductUnitData.php | 10 ++++++---- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/Marello/Bundle/OrderBundle/EventListener/Doctrine/OrderItemProductUnitListener.php b/src/Marello/Bundle/OrderBundle/EventListener/Doctrine/OrderItemProductUnitListener.php index 6daa5ea00..f96cad92d 100644 --- a/src/Marello/Bundle/OrderBundle/EventListener/Doctrine/OrderItemProductUnitListener.php +++ b/src/Marello/Bundle/OrderBundle/EventListener/Doctrine/OrderItemProductUnitListener.php @@ -18,9 +18,8 @@ class OrderItemProductUnitListener /** * @param DoctrineHelper $doctrineHelper */ - public function __construct( - DoctrineHelper $doctrineHelper - ) { + public function __construct(DoctrineHelper $doctrineHelper) + { $this->doctrineHelper = $doctrineHelper; } diff --git a/src/Marello/Bundle/OrderBundle/Migrations/Schema/v1_12/MarelloOrderBundle.php b/src/Marello/Bundle/OrderBundle/Migrations/Schema/v1_12/MarelloOrderBundle.php index 782f4cde2..b200c3819 100644 --- a/src/Marello/Bundle/OrderBundle/Migrations/Schema/v1_12/MarelloOrderBundle.php +++ b/src/Marello/Bundle/OrderBundle/Migrations/Schema/v1_12/MarelloOrderBundle.php @@ -27,7 +27,7 @@ public function up(Schema $schema, QueryBag $queries) private function updateOrderTable(Schema $schema) { - $table = $schema->createTable('marello_order_order'); + $table = $schema->getTable('marello_order_order'); $table->addColumn('delivery_date', 'datetime', ['notnull' => false]); $table->addColumn('order_note', 'text', ['notnull' => false]); $table->addColumn('po_number', 'string', ['length' => 255, 'notnull' => false]); @@ -45,7 +45,7 @@ private function updateOrderItemTable(Schema $schema) $this->extendExtension->addEnumField( $schema, $table, - 'status', + 'productUnit', 'marello_product_unit', false, false, diff --git a/src/Marello/Bundle/ProductBundle/Migrations/Data/ORM/LoadProductUnitData.php b/src/Marello/Bundle/ProductBundle/Migrations/Data/ORM/LoadProductUnitData.php index 7fc02e065..381db1d21 100644 --- a/src/Marello/Bundle/ProductBundle/Migrations/Data/ORM/LoadProductUnitData.php +++ b/src/Marello/Bundle/ProductBundle/Migrations/Data/ORM/LoadProductUnitData.php @@ -11,13 +11,15 @@ class LoadProductUnitData extends AbstractFixture { const PRODUCT_UNIT_ENUM_CLASS = 'marello_product_unit'; - const ITEM = 'item'; - const SET = 'set'; + const PU_ITEM = 'item'; + const PU_BOX = 'box'; + const PU_PALLET = 'pallet'; /** @var array */ protected $data = [ - self::ITEM => true, - self::SET => false, + self::PU_ITEM => true, + self::PU_BOX => false, + self::PU_PALLET => false ]; /**