kitodo-production
kitodo-production copied to clipboard
Export with images: no error on wrong image count
Describe the bug If you export a process (as automatic task, using the export button or calling the KitodoScript for exporting) where the amount of images are changed on a correction workflow and some body did not correct this in the meta data editor the export is successfull and the workflow is future processed instead of stopped. This will create a lot of issues for any action after the export task and the data is depending on correct export data.
To Reproduce Steps to reproduce the behavior:
- Process a process like normal
- Start a correction workflow in the meta data editor
- Add / Remove some images outside of the meta data editor and close the correction workflow successful
- Do not correct the image pagination in the meta data editor
- Export the process through the KitodoScript call, Export button click or let the workflow process the export as automatic task
Expected behavior Amount of paginated images must be equal to the amount of image files in the defined image directory or the export should not start or abort without creating the export xml files and this is important too: if the export is started by a task the task should remain open!
Release 3.4.4-SNAPSHOT
This issue is not related to #5281 as this can happen every time.
Please note that there may be media units where there are not all configured variants backed with files. For example for a phonographic recording, front cover and back cover will not have audio, and side A and side B may or may not have images. This should not lead to validation errors.
If your mentioned scenario, @matthias-ronge , should be supported then this should somehow configurable. For our use case we need this strong check as every action after the export is done will fail and cause a lot of manual corrections.
Yes, I think this should be configurable. There could be a switch in the folder settings for each folder individually, if the number of images must match for this folder in case of export, or not.
Note: If it doesn’t match, there should be a visible error before export starts (like: “Export cannot start because ...”) and not a say “Export started” and then only find a “Crash” in the task manager.
Your solution sound right but displaying an error message on an automatic task would be not so easy except this message appear on the task manager and an user is looking for this message which is not every time the case: so this message must appear in the log so you can react on this with an outside running program. But it is very important that this task is not going into the done state and must stay on an open state.
I want to add, that it is even possible to export a process without image files.
I know that hierarchical processes do not contain image files and it is absolutely necessary that these processes can be exported without image files.
But for the other processes, a validation is conducted in the metadata editor that warns that the process does not contain image files. That validation rule, which must be connected with the media type or doc type could be used to abort export of incomplete processes.