diff --git a/CHANGELOG.md b/CHANGELOG.md
index e497c42f..1fb8c761 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,7 @@
* Fixed #PAC-206: Prevent finder mappings of different libraries to be overwritten
* Fixed #PAC-317: Remove UTF-8 BOM from windows generated csv file
* Fixes #PAC-244: bug with crash in date conversion with standard date format
+* Fixes bug to add more listener when event name has already some listener
## Features
@@ -21,6 +22,8 @@
* Add #PAC-326: Cross-entity import of URLs (rewrites + redirects)
* Add #PAC-89: Add debug email command + DebugSendPlugin
* Add #PAC-57: Deleting dedicated attribute values via import by setting a configurable value
+* Add #PAC-96: Define new constands for FileUploadConfiguration
+ * https://github.com/techdivision/import/issues/181
# Version 16.5.3
diff --git a/src/Events/EmitterFactory.php b/src/Events/EmitterFactory.php
index 2259c162..301dc261 100644
--- a/src/Events/EmitterFactory.php
+++ b/src/Events/EmitterFactory.php
@@ -20,11 +20,13 @@
namespace TechDivision\Import\Events;
+use Doctrine\Common\Collections\Collection;
use League\Event\Emitter;
use League\Event\EmitterInterface;
use Symfony\Component\DependencyInjection\TaggedContainerInterface;
use TechDivision\Import\ConfigurationManagerInterface;
use TechDivision\Import\Configuration\ListenerAwareConfigurationInterface;
+use TechDivision\Import\SystemLoggerTrait;
/**
* A factory implementation to create a new event emitter instance.
@@ -38,6 +40,13 @@
class EmitterFactory implements EmitterFactoryInterface
{
+ /**
+ * The trait that provides basic filesystem handling functionality.
+ *
+ * @var \TechDivision\Import\SystemLoggerTrait
+ */
+ use SystemLoggerTrait;
+
/**
* The configuration instance.
*
@@ -64,11 +73,16 @@ class EmitterFactory implements EmitterFactoryInterface
*
* @param \TechDivision\Import\ConfigurationManagerInterface $configurationManager The configuration instance
* @param \Symfony\Component\DependencyInjection\TaggedContainerInterface $container The container instance
+ * @param \Doctrine\Common\Collections\Collection $systemLoggers The array with the system logger instances
*/
- public function __construct(ConfigurationManagerInterface $configurationManager, TaggedContainerInterface $container)
- {
+ public function __construct(
+ ConfigurationManagerInterface $configurationManager,
+ TaggedContainerInterface $container,
+ Collection $systemLoggers
+ ) {
$this->container = $container;
$this->configurationManager = $configurationManager;
+ $this->systemLoggers = $systemLoggers;
}
/**
@@ -124,8 +138,21 @@ protected function loadListeners(ListenerAwareConfigurationInterface $configurat
// prepare the listeners with the even names as key and the DI ID as value
foreach ($listenerConfigurations as $listeners) {
- foreach ($listeners as $key => $name) {
- $this->listeners[$parentName == null ? $key : sprintf('%s.%s', $parentName, $key)] = $name;
+ foreach ($listeners as $key => $listenerArray) {
+ $uniqueKeyForListener = $parentName == null ? $key : sprintf('%s.%s', $parentName, $key);
+ // no registert listener for the unique key? Simply add to optimise speed
+ if (!isset($this->listeners[$uniqueKeyForListener])) {
+ $this->listeners[$uniqueKeyForListener] = $listenerArray;
+ continue;
+ }
+ // Already registert listeners? Add each new single one
+ foreach ($listenerArray as $diValue) {
+ $this->listeners[$uniqueKeyForListener][] = $diValue;
+ }
+ $this->getSystemLogger()->debug(
+ sprintf("More than one registert listeners for %s", $uniqueKeyForListener),
+ $this->listeners[$uniqueKeyForListener]
+ );
}
}
}
diff --git a/src/Utils/FileUploadConfigurationKeys.php b/src/Utils/FileUploadConfigurationKeys.php
index 1000440a..44e57eb8 100644
--- a/src/Utils/FileUploadConfigurationKeys.php
+++ b/src/Utils/FileUploadConfigurationKeys.php
@@ -54,4 +54,11 @@ class FileUploadConfigurationKeys
* @var string
*/
const COPY_IMAGES = 'copy-images';
+
+ /**
+ * Name for the column 'override-images'.
+ *
+ * @var string
+ */
+ const OVERRIDE_IMAGES = 'override-images';
}
diff --git a/symfony/Resources/config/services.xml b/symfony/Resources/config/services.xml
index a98be4a5..f0741048 100644
--- a/symfony/Resources/config/services.xml
+++ b/symfony/Resources/config/services.xml
@@ -860,6 +860,7 @@
+