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

[BUGFIX] Fix regression for METS files without physical structure #1417

Merged
merged 5 commits into from
Dec 27, 2024

Conversation

stweil
Copy link
Member

@stweil stweil commented Dec 26, 2024

No description provided.

@stweil
Copy link
Member Author

stweil commented Dec 26, 2024

Without this fix, anchor or year METS files of periodicals cause a runtime error because they don't have a physical structure. The access to index 1 of the empty array fails ($this->physicalStructure[1]).

A newspaper may have years where some months are missing.
This must not cause a runtime error.

Signed-off-by: Stefan Weil <[email protected]>
@stweil
Copy link
Member Author

stweil commented Dec 27, 2024

Related issue: slub/dfg-viewer#327. The modifications were needed to fix runtime errors with anchor and year METS files of newspapers. Those METS files don't contain a physical structure, and there may be missing years and missing months. The additional tests catch these special cases.

Even with this pull request, the calendar views still don't work with TYPO3 12, partially because the URL argument tx_dlf[id] is missing (it is replaced by tx_dlf_calendar[id]). The log file shows errors like this one:

Fri, 27 Dec 2024 19:59:43 +0000 [ERROR] request="02ad6d0794050" component="Kitodo.Dlf.Controller.AbstractController": Invalid ID "0" or PID "3" for document loading 

@sebastian-meyer sebastian-meyer self-requested a review December 27, 2024 21:39
@sebastian-meyer sebastian-meyer added the 🐛 bug A non-security related bug. label Dec 27, 2024
Copy link

codecov bot commented Dec 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (b452185) to head (0fc501d).
Report is 1 commits behind head on main.

Additional details and impacted files
@@     Coverage Diff      @@
##   main   #1417   +/-   ##
============================
============================

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sebastian-meyer sebastian-meyer changed the title Fix regression for METS files without physical structure [BUGFIX] Fix regression for METS files without physical structure Dec 27, 2024
@sebastian-meyer sebastian-meyer merged commit 4b3a130 into kitodo:main Dec 27, 2024
8 checks passed
@stweil stweil deleted the fix branch December 28, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug A non-security related bug.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants