diff --git a/CHANGELOG.md b/CHANGELOG.md index 22cef4c..0854ca6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# Version 26.0.2 + +## Bugfixes + +* Fixing clean-up links if the data in the file is missing, the value is not set to \_\_EMPTY__VALUE__ and the clean-up links configuration is disabled + # Version 26.0.1 ## Bugfixes diff --git a/src/Observers/CleanUpLinkObserver.php b/src/Observers/CleanUpLinkObserver.php index 408f66b..47cb721 100644 --- a/src/Observers/CleanUpLinkObserver.php +++ b/src/Observers/CleanUpLinkObserver.php @@ -117,6 +117,9 @@ protected function process() // load the row/entity ID of the parent product $parentId = $this->getLastPrimaryKey(); + // remove all the empty values from the row + $row = $this->clearRow(); + $this->setRow($row); // prepare the links for the found link types and clean-up foreach ($this->linkTypes as $linkTypeCode => $columns) { // shift the column with the header information from the stack @@ -131,11 +134,13 @@ protected function process() // the clean-up columns functionality in the // AttributeObserverTrait::clearRow() method has NOT unset the // column which indicates the column has to be cleaned-up. - if ($this->cleanUpLinks === true || ($this->hasColumn($columnNameChildSkus))) { + if ($this->cleanUpLinks === true || ($this->hasColumn($columnNameChildSkus) && $this->getValue($columnNameChildSkus) === null)) { // clean-up the links in the database $this->doCleanUp($parentId, $linkTypeCode, $links); } } + // set the origin row again + $this->setRow($this->getSubject()->getRow()); } /**