Can't sideload media after a csv import

Hi,
I’ve been trying to populate my Omeka-s installation via CSV, which it does quite well, even correctly duplicating my dcterms:identity from a semicolon separated field.
But, when I visit the item record to add media via sideload I get this error:

Doctrine\ORM\ORMInvalidArgumentException
A new entity was found through the relationship ‘AltText\Entity\AltText#media’ that was not configured to cascade persist operations for entity: Omeka\Entity\Media@000000001dc3bb580000000013013f1d. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(…,cascade={“persist”}). If you cannot find out which entity causes the problem implement ‘Omeka\Entity\Media#__toString()’ to get a clue.

Details:

Doctrine\ORM\ORMInvalidArgumentException: A new entity was found through the relationship ‘AltText\Entity\AltText#media’ that was not configured to cascade persist operations for entity: Omeka\Entity\Media@000000001dc3bb580000000013013f1d. To solve this issue: Either explicitly call EntityManager#persist() on this unknown entity or configure cascade persist this association in the mapping for example @ManyToOne(…,cascade={“persist”}). If you cannot find out which entity causes the problem implement ‘Omeka\Entity\Media#__toString()’ to get a clue. in /var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:92 Stack trace: #0 /var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(852): Doctrine\ORM\ORMInvalidArgumentException::newEntityFoundThroughRelationship(Array, Object(Omeka\Entity\Media)) #1 /var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(740): Doctrine\ORM\UnitOfWork->computeAssociationChanges(Array, Object(Omeka\Entity\Media)) #2 /var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(452): Doctrine\ORM\UnitOfWork->computeChangeSet(Object(Doctrine\ORM\Mapping\ClassMetadata), Object(AltText\Entity\AltText)) #3 /var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(765): Doctrine\ORM\UnitOfWork->computeScheduleInsertsChangeSets() #4 /var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(340): Doctrine\ORM\UnitOfWork->computeChangeSets() #5 /var/www/html/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(356): Doctrine\ORM\UnitOfWork->commit(NULL) #6 /var/www/html/application/src/Api/Adapter/AbstractEntityAdapter.php(353): Doctrine\ORM\EntityManager->flush() #7 /var/www/html/application/src/Api/Manager.php(233): Omeka\Api\Adapter\AbstractEntityAdapter->update(Object(Omeka\Api\Request)) #8 /var/www/html/application/src/Api/Manager.php(136): Omeka\Api\Manager->execute(Object(Omeka\Api\Request)) #9 /var/www/html/application/src/Mvc/Controller/Plugin/Api.php(152): Omeka\Api\Manager->update(‘items’, ‘814’, Array, Array, Array) #10 /var/www/html/application/src/Controller/Admin/ItemController.php(241): Omeka\Mvc\Controller\Plugin\Api->update(‘items’, ‘814’, Array, Array) #11 /var/www/html/vendor/zendframework/zend-mvc/src/Controller/AbstractActionController.php(78): Omeka\Controller\Admin\ItemController->editAction() #12 /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\Controller\AbstractActionController->onDispatch(Object(Zend\Mvc\MvcEvent)) #13 /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure)) #14 /var/www/html/vendor/zendframework/zend-mvc/src/Controller/AbstractController.php(106): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent)) #15 /var/www/html/vendor/zendframework/zend-mvc/src/DispatchListener.php(138): Zend\Mvc\Controller\AbstractController->dispatch(Object(Zend\Http\PhpEnvironment\Request), Object(Zend\Http\PhpEnvironment\Response)) #16 /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php(322): Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent)) #17 /var/www/html/vendor/zendframework/zend-eventmanager/src/EventManager.php(179): Zend\EventManager\EventManager->triggerListeners(Object(Zend\Mvc\MvcEvent), Object(Closure)) #18 /var/www/html/vendor/zendframework/zend-mvc/src/Application.php(332): Zend\EventManager\EventManager->triggerEventUntil(Object(Closure), Object(Zend\Mvc\MvcEvent)) #19 /var/www/html/index.php(21): Zend\Mvc\Application->run() #20 {main}

I’ve pulled out too much hair trying to figure this out. If I create a new item from scratch, file sideload works like a charm. Any hints on what is causing this? I’m using Omeka-S 1.3.0, Mariadb 5.5.60, PHP 7.2.15.

Thanks in advance, Peter.

The error you’re getting is coming from the Alt Text module… but it may just be hiding whatever the “real” error is…

Can you try disabling Alt Text and seeing if that either fixes the issue or gives you a different error message?

Thanks a lot John! Just disabled Alt Text and presto! Works like a charm.

-Peter

Hmmm, okay. I’m not sure what the issue with Alt Text is here, then. In particular, what would be different about media loaded from an import… there should be no difference. Maybe the difference was actually something like… only adding additional media to any item caused the problem, not necessarily adding specifically to imported items.

I’ve seen one other report of this error in a different context but I haven’t been able to reproduce it.

This should be fixed with Alt Text 1.0.2.