-
Notifications
You must be signed in to change notification settings - Fork 29
Closed
Labels
bugBreaks something but is not blockingBreaks something but is not blockingenhancementImprovement of an existing featureImprovement of an existing featuref: activity-logsEverything around logging user or system activitiesEverything around logging user or system activitiesf: editorConcerns editor based on JSON schema AND custom editorConcerns editor based on JSON schema AND custom editor
Description
Describe the bug
If the parallel appear before the proper title in the array of field title, this generates a bug:
- error message in the circulation interface when trying to check out/in an item linked to this document
This problem is due to the operation logs, that are not able to retrieve the field title._text
Example of document causing the problem:
"title": [
{
"mainTitle": [
{
"value": "Le voyage imaginaire"
}
],
"type": "bf:ParallelTitle"
},
{
"_text": "Cirque du Soleil = Le voyage imaginaire",
"mainTitle": [
{
"value": "Cirque du Soleil"
}
],
"type": "bf:Title"
}
]To Reproduce
See example above.
Expected behavior
The correction must be made on 2 levels
-
JSON schema: It is not possible to save a document with a first title of a type other than
bf:Title -
Operation logs: they should be able to retrieve
title._textin any position of the array (see code below)@classmethod def _get_document_data(cls, document_pid): """Get document record data. :param str document_pid: Document PID :returns: Document formatted data :rtype: dict """ document = Document.get_record_by_pid(document_pid) document = document.dumps() return { 'pid': document['pid'], 'title': document['title'][0]['_text'], 'type': document['type'][0].get('subtype', document['type'][0]['main_type']) }
Context
- server: ils.test.rero.ch
- version:
v1.6.1
Metadata
Metadata
Assignees
Labels
bugBreaks something but is not blockingBreaks something but is not blockingenhancementImprovement of an existing featureImprovement of an existing featuref: activity-logsEverything around logging user or system activitiesEverything around logging user or system activitiesf: editorConcerns editor based on JSON schema AND custom editorConcerns editor based on JSON schema AND custom editor