You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When Shopware is run with MariaDB and the old articles attributes definition from before 5.3 is still present (s_articles_attributes) illegal attribute models are generated based on the column definition:
The broken code is generated in /var/cache/production____REVISION___/doctrine/attributes/Article.php:
/** * @var date $attr17 * * @ORM\Column(name="attr17", type="date", nullable=true) */protected$attr17;
...
public function__construct()
{
...$this->attr15 = "NULL";
$this->attr16 = "NULL";
$this->attr17 = new \DateTime("NULL");
$this->attr18 = "NULL";
...
}
The following exception is thrown, for example when duplicating an article in the backend: DateTime::__construct(): Failed to parse time string (NULL) at position 0 (N): The timezone could not be found in the database in var/cache/production____REVISION___/doctrine/attributes/Article.php on line 299
But the exception thrown for DATE columns is not the only problem, all attributes without a default value will be initialized with the string "NULL" (see attr15 above for example) with all MariaDB versions >= 10.2.7. The MariaDB handling of default values inINFORMATION_SCHEMA deviates from MySQL and the MariaDB devs decided that they do not want to change that anymore, but Doctrine is working on compatibility to both approaches. All of this discussion can be found here (including the linked issues): doctrine/orm#6565
Apparently doctrine/dbal2.7.0 will resolve this, but even on the Shopware 5.4 branch version 2.5.4 is still shipped.
MySQL 5.7 was released 2015-10-21 and made most of the reasons for recommending MariaDB (better performance and easier configuration/more sensible defaults) obsolete.
The text was updated successfully, but these errors were encountered:
samuelvogel
added
the
bug
Issues that describe an unexpected behaviour in an existing functionality.
label
Nov 22, 2017
When Shopware is run with MariaDB and the old articles attributes definition from before
5.3
is still present (s_articles_attributes
) illegal attribute models are generated based on the column definition:MariaDB is not officially supported but nevertheless "recommended" in the Shopware performance guide and also by some agencies.
The broken code is generated in
/var/cache/production____REVISION___/doctrine/attributes/Article.php
:The following exception is thrown, for example when duplicating an article in the backend:
DateTime::__construct(): Failed to parse time string (NULL) at position 0 (N): The timezone could not be found in the database in var/cache/production____REVISION___/doctrine/attributes/Article.php on line 299
The attribute (
s_articles_attributes.attr17
) was normalized with Shopware5.3
, but this only applies for fresh installations not existing ones which are updated: https://github.com/shopware/shopware/blob/5325f6c831e4f6101ae1669494323475a38dce58/_sql/migrations/808-change-varchar-attributes.php#L32And it's still possible to create problematic date attributes via the backend:
But the exception thrown for
DATE
columns is not the only problem, all attributes without a default value will be initialized with the string"NULL"
(seeattr15
above for example) with all MariaDB versions >=10.2.7
. The MariaDB handling of default values inINFORMATION_SCHEMA
deviates from MySQL and the MariaDB devs decided that they do not want to change that anymore, but Doctrine is working on compatibility to both approaches. All of this discussion can be found here (including the linked issues): doctrine/orm#6565Apparently
doctrine/dbal
2.7.0
will resolve this, but even on the Shopware5.4
branch version2.5.4
is still shipped.MySQL
5.7
was released 2015-10-21 and made most of the reasons for recommending MariaDB (better performance and easier configuration/more sensible defaults) obsolete.The text was updated successfully, but these errors were encountered: