Can anyone help me figure out what I’m doing wrong? I get this error ALMOST every time I try to save an item with an inverse property:
Doctrine\ORM\ORMInvalidArgumentException
A new entity was found through the relationship ‘Omeka\Entity\Value#resource’ that was not configured to cascade persist operations for entity: Omeka\Entity\Item@2133. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example #[ORM\ManyToOne(…, cascade: [‘persist’])]. If you cannot find out which entity causes the problem implement ‘Omeka\Entity\Resource#__toString()’ to get a clue.
Details:
Doctrine\ORM\ORMInvalidArgumentException: A new entity was found through the relationship ‘Omeka\Entity\Value#resource’ that was not configured to cascade persist operations for entity: Omeka\Entity\Item@2133. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example #[ORM\ManyToOne(…, cascade: [‘persist’])]. If you cannot find out which entity causes the problem implement ‘Omeka\Entity\Resource#__toString()’ to get a clue. in /var/www/html/vendor/doctrine/orm/src/ORMInvalidArgumentException.php:103 Stack trace: #0 /var/www/html/vendor/doctrine/orm/src/UnitOfWork.php(3864): Doctrine\ORM\ORMInvalidArgumentException::newEntitiesFoundThroughRelationships(Array) #1 /var/www/html/vendor/doctrine/orm/src/UnitOfWork.php(418): Doctrine\ORM\UnitOfWork->assertThatThereAreNoUnintentionallyNonPersistedAssociations() #2 /var/www/html/vendor/doctrine/orm/src/EntityManager.php(414): Doctrine\ORM\UnitOfWork->commit(NULL) #3 /var/www/html/volume/modules/InverseProperties/src/Stdlib/InverseProperties.php(170): Doctrine\ORM\EntityManager->flush() #4 /var/www/html/volume/modules/InverseProperties/Module.php(154): InverseProperties\Stdlib\InverseProperties->setInversePropertyValues(Object(Omeka\Entity\Item)) #5 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(318): InverseProperties\Module->setInversePropertyValues(Object(Laminas\EventManager\Event)) #6 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(168): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\EventManager\Event)) #7 /var/www/html/application/src/Api/Manager.php(323): Laminas\EventManager\EventManager->triggerEvent(Object(Laminas\EventManager\Event)) #8 /var/www/html/application/src/Api/Manager.php(269): Omeka\Api\Manager->finalize(Object(Omeka\Api\Adapter\ItemAdapter), Object(Omeka\Api\Request), Object(Omeka\Api\Response)) #9 /var/www/html/application/src/Api/Manager.php(78): Omeka\Api\Manager->execute(Object(Omeka\Api\Request)) #10 /var/www/html/application/src/Mvc/Controller/Plugin/Api.php(100): Omeka\Api\Manager->create(‘items’, Array, Array, Array) #11 /var/www/html/application/src/Controller/Admin/ItemController.php(217): Omeka\Mvc\Controller\Plugin\Api->create(‘items’, Array, Array) #12 /var/www/html/vendor/laminas/laminas-mvc/src/Controller/AbstractActionController.php(72): Omeka\Controller\Admin\ItemController->addAction() #13 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(318): Laminas\Mvc\Controller\AbstractActionController->onDispatch(Object(Laminas\Mvc\MvcEvent)) #14 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(176): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #15 /var/www/html/vendor/laminas/laminas-mvc/src/Controller/AbstractController.php(105): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #16 /var/www/html/vendor/laminas/laminas-mvc/src/DispatchListener.php(117): Laminas\Mvc\Controller\AbstractController->dispatch(Object(Laminas\Http\PhpEnvironment\Request), Object(Laminas\Http\PhpEnvironment\Response)) #17 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(318): Laminas\Mvc\DispatchListener->onDispatch(Object(Laminas\Mvc\MvcEvent)) #18 /var/www/html/vendor/laminas/laminas-eventmanager/src/EventManager.php(176): Laminas\EventManager\EventManager->triggerListeners(Object(Laminas\Mvc\MvcEvent), Object(Closure)) #19 /var/www/html/vendor/laminas/laminas-mvc/src/Application.php(319): Laminas\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Laminas\Mvc\MvcEvent)) #20 /var/www/html/index.php(26): Laminas\Mvc\Application->run() #21 {main}
Omeka S is running in docker. Mostly these properties are reciprocated to the same property–e.g. relation to relation:
| Property | Inverse property | Alternate label | Data types |
|---|---|---|---|
| Dublin Core : Title | Name (Maiden if Married) | ||
| Dublin Core : Temporal Coverage | Life Dates (Birth / Death) | * Text |
- Timestamp|
|Dublin Core : Alternative Title||Alternate / Married Names||
|Dublin Core : Spatial Coverage||Life Locations (Birth / Death)|* Text - Item|
|Dublin Core : Relation||Family Connections|* Item|
|Dublin Core : Identifier||External Genealogy ID|* URI|
|Dublin Core : Is Referenced By||Archival Sources & Photos|* All|