Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
# Version 18.3.1

## Bugfixes

* Fix `AttributeObserverTrait::mergeEntity()`: columns with a default value (`default-values`) were never emptied by `clean-up-empty-columns`, because the attribute code was looked up in the list of header positions
* Fix XML DI configuration loading for `symfony/dependency-injection` 6.4 and 7.x: `ImportExtension` uses the loader shipped with Symfony again and falls back to the copied `XmlFileLoader` only where it is not available (Symfony 8)

# Version 18.3.0

## Features
Expand Down
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"league/event": "^2.2",
"ramsey/uuid": "^4.2|^4.7",
"symfony/mailer": "^5.4|^6.4|^7.4",
"symfony/dependency-injection": "^6.4|^7.0|^8.0",
"laminas/laminas-filter": "^2.31",
"techdivision/import-dbal": "^2.1",
"techdivision/import-dbal-collection": "^2.2",
Expand Down
6 changes: 4 additions & 2 deletions src/Observers/AttributeObserverTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,11 @@ protected function mergeEntity(array $entity, array $attr, $changeSetName = null
// if the value is empty AND it is IN the array with default column values
// BUT it is NOT in the array with columns we want to clean-up the default
// column value has to be removed, because we do NOT want to override the
// value existing in the database
// value existing in the database. The clean-up column keys are the header
// positions of the columns, so the attribute code has to be translated first
if (array_key_exists($this->attributeCode, $this->getDefaultColumnValues()) &&
array_key_exists($this->attributeCode, $this->getCleanUpEmptyColumnKeys()) === false
!($this->hasHeader($this->attributeCode) &&
in_array($this->getHeader($this->attributeCode), $this->getCleanUpEmptyColumnKeys() ?? [], true))
) {
// remove the value from the array with the column values, because
// this is the default value from the database and it should NOT
Expand Down
6 changes: 5 additions & 1 deletion symfony/DependencyInjection/ImportExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\Config\FileLocator;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader as SymfonyXmlFileLoader;
use TechDivision\Import\DependencyInjection\Loader\XmlFileLoader;

/**
Expand All @@ -39,7 +40,10 @@ class ImportExtension extends Extension
*/
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new XmlFileLoader($container, new FileLocator(dirname(__DIR__) . '/Resources/config'));
// use the XML loader shipped with symfony/dependency-injection where available (6.4 and 7.x),
// symfony 8 removed it, so the copy of the 7.x loader has to be used there
$loaderClass = class_exists(SymfonyXmlFileLoader::class) ? SymfonyXmlFileLoader::class : XmlFileLoader::class;
$loader = new $loaderClass($container, new FileLocator(dirname(__DIR__) . '/Resources/config'));
$loader->load('services.xml');
}
}
Loading