diff --git a/src/Resolver/Location/FindParentStrategy.php b/src/Resolver/Location/FindParentStrategy.php index 763bc714..8dc60e30 100644 --- a/src/Resolver/Location/FindParentStrategy.php +++ b/src/Resolver/Location/FindParentStrategy.php @@ -15,6 +15,7 @@ namespace Pimcore\Bundle\DataImporterBundle\Resolver\Location; +use Exception; use Pimcore\Bundle\DataImporterBundle\Exception\InvalidConfigurationException; use Pimcore\Bundle\DataImporterBundle\Exception\InvalidInputException; use Pimcore\Bundle\DataImporterBundle\Tool\DataObjectLoader; @@ -148,14 +149,14 @@ public function updateParent(ElementInterface $element, array $inputData): Eleme $this->saveAsVariant && $element instanceof DataObject\Concrete && $element::class === $newParent::class - && $element->getClass()->getAllowVariants() && !$element->hasChildren() + && $element->getClass()->getAllowVariants() ) { $element->setType(AbstractObject::OBJECT_TYPE_VARIANT); } return $element->setParent($newParent); - } catch (NotFoundException $e) { + } catch (Exception) { // Exception might be thrown by $element->getClass(). } }