Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP error on "Append data to the resource" and "Revise data of the resource" csv import #209

Open
mgaldemar opened this issue Apr 25, 2023 · 5 comments

Comments

@mgaldemar
Copy link

mgaldemar commented Apr 25, 2023

Scenario
The csv import has been failing for these types of imports :

  • Append data to the resource
  • Revise data of the resource
    Data modele
    This my data modele : o:id,dcterms:title,vra:title,dcterms:alternative,dcterms:creator,dcterms:created,vra:locationCreationSite,dcterms:spatial,dcterms:type,vra:material,vra:technique,vra:measurementsDimensions,dcterms:subject,dcterms:description,dcterms:bibliographicCitation,dcterms:relation,dcterms:isVersionOf,dcterms:isReferencedBy,dcterms:ispartof,dcterms:contributor,dcterms:rights,dcterms:license,foaf:isPrimaryTopicOf
    The data are mainly strings of text (dates included) and uri. The spreadsheet separating character is a comma and the § is used for repeatable fields.
    Software
  1. Php8.0
  2. omekaS 4.0.1
  3. CSV Import version 2.4.1
  4. Generic module version 3.4.43
    error message
Erreur fatale : Uncaught Error: Call to a member function getParam() on null in /var/www/omeka-s/application/src/Api/Representation/ItemRepresentation.php:109
Stack trace:
#0 /var/www/omeka-s/application/src/Api/Representation/AbstractResourceRepresentation.php(179): Omeka\Api\Representation\ItemRepresentation->siteUrl()
#1 /var/www/omeka-s/application/src/Api/Representation/AbstractResourceEntityRepresentation.php(715): Omeka\Api\Representation\AbstractResourceRepresentation->url()
#2 /var/www/omeka-s/application/src/DataType/Resource/AbstractResource.php(100): Omeka\Api\Representation\AbstractResourceEntityRepresentation->valueRepresentation()
#3 /var/www/omeka-s/application/src/Api/Representation/ValueRepresentation.php(87): Omeka\DataType\Resource\AbstractResource->getJsonLd()
#4 [internal function]: Omeka\Api\Representation\ValueRepresentation->jsonSerialize()
#5 /var/www/omeka-s/modules/CSVImport/src/Job/Import.php(784): json_encode()
#6 /var/www/omeka-s/modules/CSVImport/src/Job/Import.php(427): CSVImport\Job\Import->updateRevise()
#7 /var/www/omeka-s/modules/CSVImport/src/Job/Import.php(296): CSVImport\Job\Import->update()
#8 /var/www/omeka-s/modules/CSVImport/src/Job/Import.php(194): CSVImport\Job\Import->processBatchData()
#9 /var/www/omeka-s/application/src/Job/DispatchStrategy/Synchronous.php(34): CSVImport\Job\Import->perform()
#10 /var/www/omeka-s/modules/Log/src/Job/Dispatcher.php(32): Omeka\Job\DispatchStrategy\Synchronous->send()
#11 /var/www/omeka-s/application/data/scripts/perform-job.php(66): Log\Job\Dispatcher->send()
#12 {main}throwndans /var/www/omeka-s/application/src/Api/Representation/ItemRepresentation.php ligne 109

Thank you. Michèle

@pbcGIS
Copy link

pbcGIS commented Apr 30, 2023

I also have a prolem with the Revise mode of CSV Import. In my case, I'm using Omeka-S 4.01, and the CSV module 2.4.1

I'm testing the Revise option and get the error trace as follows:

2023-04-30T21:13:43+00:00 INFO (6): 2 item_sets were updated (revise): "cdf_East_Place_and_Street" (16040), "cdf_Bridge_Street" (16039). {"userId":3,"jobId":314}
2023-04-30T21:13:43+00:00 ERR (3): Doctrine\ORM\ORMInvalidArgumentException: **Multiple non-persisted new entities were found through the given association graph**:

 * A new entity was found through the relationship 'Omeka\Entity\ResourceTemplateProperty#property' that was not configured to cascade persist operations for entity: DoctrineProxies\__CG__\Omeka\Entity\Property@1230. 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\Property#__toString()' to get a clue.
 * A new entity was found through the relationship 'Omeka\Entity\ResourceTemplateProperty#property' that was not configured to cascade persist operations for entity: DoctrineProxies\__CG__\Omeka\Entity\Property@1232. 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\Property#__toString()' to get a clue.
 * A new entity was found through the relationship 'Omeka\Entity\ResourceTemplateProperty#property' that was not configured to cascade persist operations for entity: DoctrineProxies\__CG__\Omeka\Entity\Property@1234. 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\Property#__toString()' to get a clue. in /var/www/html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/ORMInvalidArgumentException.php:100
Stack trace:
#0 /var/www/html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(3521): Doctrine\ORM\ORMInvalidArgumentException::newEntitiesFoundThroughRelationships(Array)
#1 /var/www/html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php(390): Doctrine\ORM\UnitOfWork->assertThatThereAreNoUnintentionallyNonPersistedAssociations()
#2 /var/www/html/omeka-s/vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(392): Doctrine\ORM\UnitOfWork->commit(NULL)
#3 /var/www/html/omeka-s/application/src/Api/Adapter/AbstractEntityAdapter.php(447): Doctrine\ORM\EntityManager->flush()
#4 /var/www/html/omeka-s/application/src/Api/Manager.php(233): Omeka\Api\Adapter\AbstractEntityAdapter->update(Object(Omeka\Api\Request))
#5 /var/www/html/omeka-s/application/src/Api/Manager.php(136): Omeka\Api\Manager->execute(Object(Omeka\Api\Request))
#6 /var/www/html/cdash-persist/modules/CSVImport/src/Job/Import.php(1210): Omeka\Api\Manager->update('csvimport_impor...', 18, Array)
#7 /var/www/html/cdash-persist/modules/CSVImport/src/Job/Import.php(203): CSVImport\Job\Import->endJob()
#8 /var/www/html/omeka-s/application/src/Job/DispatchStrategy/Synchronous.php(34): CSVImport\Job\Import->perform()
#9 /var/www/html/cdash-persist/modules/Log/src/Job/Dispatcher.php(32): Omeka\Job\DispatchStrategy\Synchronous->send(Object(Omeka\Entity\Job))
#10 /var/www/html/omeka-s/application/data/scripts/perform-job.php(66): Log\Job\Dispatcher->send(Object(Omeka\Entity\Job), Object(Log\Job\DispatchStrategy\Synchronous))
#11 {main} {"userId":3,"jobId":314}

@zerocrates
Copy link
Contributor

@pbcGIS I think you're describing a different problem. Could you file a separate issue for it? And also include the "system information" output in that issue: I'm particularly interested to know what other modules you have.

@zerocrates
Copy link
Contributor

@mgaldemar If you temporarily disable all modules other than the CSV Import module, does this problem still happen?

The odd thing about your error is, you're hitting a codepath for calculating a URL that only should happen when viewing a "site" page, a public page. It shouldn't be happening in the background job for the import, as is happening here. So one thing I'm thinking is that maybe another module is causing a "site" request to be detected here incorrectly.

@mgaldemar
Copy link
Author

@zerocrates You are right, when all the modules are temporarily disabled, the updating csv import works thoroughly (text, uri, omeka id links) for unique and multivalued fields. A global testing session is meant to be organized to check and identify the module(s) that create(s) the failure. I'll let you know all about the issue developments and tests. Thank you.

@mgaldemar
Copy link
Author

Hello everyone.
I have checked all the modules used on my OmekaS instance and found the one that fail the CSV import.
It's the Clean Url (https://gitlab.com/Daniel-KM/omeka-s-module-CleanUrl) version 3.17.6
When Clean Url is desactivated, the CSV import works.
Thank you.

Michèle
PS : The others modules are : advanced search v3.4.11 ; Annotate v3.4.3.8-beta-4 ; Annotate images and maps v3.4.1.4-beta-2 ; Bulk Export v3.4.23 ; Bulk Import v3.4.44 ; CSSEditor v1.3.1 ; CSV Import v2.4.1 ; Custom Vocab v2.0.1 ; Data Type Geometry v3.4.3 ; Data Type RDF v3.4.4.5.1 ; Data Visualization v1.1.0 ; Easy Admin v3.4.12 ; File Sideload v1.7.1 ; Generic module v3.4.44 ; Guest v3.4.17 ; IIIF Server v3.6.9 ; Image Server v3.6.14 ; Item Carousel Block v1.2.0 ; LDAP v0.4.0 ; Log v3.4.16 ; Mapping v1.9.1 ; Metadata Browse v1.6.0 ; Numeric Data Types v1.10.0 ; Reference v3.4.43 ; Sharing v1.4.0 ; Universal viewer v3.6.7 ; Value suggest v1.16.1 ; Zotero import v.1.3.0)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants