kitodo / kitodo-presentation

Kitodo.Presentation is a feature-rich framework for building a METS- or IIIF-based digital library. It is part of the Kitodo Digital Library Suite.
https://kitodo.github.io/kitodo-presentation/
GNU General Public License v3.0
39 stars 45 forks source link

[BUG] Runtime warnings from dlf extension #1366

Open stweil opened 1 week ago

stweil commented 1 week ago

Description

This is a collection of warnings which are reported in a composer test installation of TYPO3 11 with dfgviewer (master + PR for TYPO3 12), dlf (e1b180cd8a83f21a94f15f1a568f736416403f79) and slub_digitalcollections on Debian stable.

Most warnings are related to the handling of a METS document.

Reproduction

Steps to reproduce the behaviour:

  1. Install with the components listed above.
  2. Load some example (in this case from SLUB) in installed DFG viewer.
  3. See errors in var/log/typo3_*.log

Expected Behavior

No warnings.

Screenshots and Examples

[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Trying to access array offset on value of type null in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key "context" in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key "creationDate" in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key "issue" in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key "multipleSource" in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Controller/AbstractController.php line 584 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key "parentAuthor" in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key "parentPlace" in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key "parentYear" in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key "vd16" in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key "vd17" in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 
[WARNING] request="7f4067d0520b7" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: Undefined array key 0 in /var/www/typo3_11/public/typo3conf/ext/dlf/Classes/Common/MetsDocument.php line 848 

Environment

Additional Context

The test was run in Podman Desktop.

stweil commented 1 week ago

Related commit for Classes/Common/MetsDocument.php: d7d6ce6a8.

sebastian-meyer commented 1 week ago

Like many other bugs this was introduced with the somewhat rushed PR #1281. I assigned all those bugs to you, @chrizzor. Please have a look at them!

markusweigelt commented 1 week ago

@stweil Problem is already fixed. https://github.com/kitodo/kitodo-presentation/blob/f4f53a8de218348b4429f959a135de66ad0dfc37/Classes/Common/MetsDocument.php#L849 Please update your dlf extension to the state of the current master branch.

stweil commented 1 week ago

With the very latest code from git master, I get these warnings:

Thu, 24 Oct 2024 10:03:36 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "originalIiifMetadata" not set, using default value "0". Probably FlexForm for controller "Kitodo\Dlf\Controller\MetadataController" is not read. 
Thu, 24 Oct 2024 10:03:36 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "displayIiifDescription" not set, using default value "1". Probably FlexForm for controller "Kitodo\Dlf\Controller\MetadataController" is not read. 
Thu, 24 Oct 2024 10:03:36 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "displayIiifRights" not set, using default value "1". Probably FlexForm for controller "Kitodo\Dlf\Controller\MetadataController" is not read. 
Thu, 24 Oct 2024 10:03:36 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "displayIiifLinks" not set, using default value "1". Probably FlexForm for controller "Kitodo\Dlf\Controller\MetadataController" is not read. 
Thu, 24 Oct 2024 10:03:36 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "originalIiifMetadata" not set, using default value "0". Probably FlexForm for controller "Kitodo\Dlf\Controller\MetadataController" is not read. 
Thu, 24 Oct 2024 10:03:36 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "displayIiifDescription" not set, using default value "1". Probably FlexForm for controller "Kitodo\Dlf\Controller\MetadataController" is not read. 
Thu, 24 Oct 2024 10:03:36 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "displayIiifRights" not set, using default value "1". Probably FlexForm for controller "Kitodo\Dlf\Controller\MetadataController" is not read. 
Thu, 24 Oct 2024 10:03:36 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "displayIiifLinks" not set, using default value "1". Probably FlexForm for controller "Kitodo\Dlf\Controller\MetadataController" is not read. 
Thu, 24 Oct 2024 10:03:48 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "storagePid" not set, using default value "0". Probably FlexForm for controller "Slub\Dfgviewer\Controller\UriController" is not read. 
Thu, 24 Oct 2024 10:03:48 +0000 [WARNING] request="6c632fd76bfe6" component="Kitodo.Dlf.Controller.AbstractController": Setting "storagePid" not set, using default value "0". Probably FlexForm for controller "Slub\Dfgviewer\Controller\UriController" is not read. 
stweil commented 1 week ago

I now updated dfgviewer, too, to the latest git master. This breaks my test URL (http://localhost:8080/viewer?tx_dlf[id]=https%3A%2F%2Fdigital.slub-dresden.de%2Foai%2F%3Fverb%3DGetRecord%26metadataPrefix%3Dmets%26identifier%3Doai%3Ade%3Aslub-dresden%3Adb%3Aid-263566811). It now only shows the same page as http://localhost:8080/viewer.

The logfile shows these warnings every few minutes:

Thu, 24 Oct 2024 11:14:29 +0000 [ERROR] request="f89dfa5ed00a0" component="TYPO3.CMS.Frontend.Configuration.TypoScript.ConditionMatching.ConditionMatcher": Expression could not be parsed. - {"expression":"getTSFE()?.id == 1"}
Thu, 24 Oct 2024 11:14:29 +0000 [ERROR] request="f89dfa5ed00a0" component="TYPO3.CMS.Frontend.Configuration.TypoScript.ConditionMatching.ConditionMatcher": Expression could not be parsed. - {"expression":"getTSFE()?.id == 2"}
markusweigelt commented 1 week ago

I now updated dfgviewer, too, to the latest git master. This breaks my test URL (http://localhost:8080/viewer?tx_dlf[id]=https%3A%2F%2Fdigital.slub-dresden.de%2Foai%2F%3Fverb%3DGetRecord%26metadataPrefix%3Dmets%26identifier%3Doai%3Ade%3Aslub-dresden%3Adb%3Aid-263566811). It now only shows the same page as http://localhost:8080/viewer.

The logfile shows these warnings every few minutes:

Thu, 24 Oct 2024 11:14:29 +0000 [ERROR] request="f89dfa5ed00a0" component="TYPO3.CMS.Frontend.Configuration.TypoScript.ConditionMatching.ConditionMatcher": Expression could not be parsed. - {"expression":"getTSFE()?.id == 1"}
Thu, 24 Oct 2024 11:14:29 +0000 [ERROR] request="f89dfa5ed00a0" component="TYPO3.CMS.Frontend.Configuration.TypoScript.ConditionMatching.ConditionMatcher": Expression could not be parsed. - {"expression":"getTSFE()?.id == 2"}

Seams to be a DFG-Viewer problem with https://github.com/slub/dfg-viewer/pull/322 cause this expression getTSFE()?.id is not used in master and in Kitodo.Presentation.

markusweigelt commented 6 days ago

@stweil I initially tested the update only in TYPO3 version 12. I have now set up a development environment with TYPO3 version 11 in parallel. I was able to resolve the issue with the incorrect test URL. The branch https://github.com/markusweigelt/kitodo-presentation/tree/fixed-typo3-12 will be submitted as a PR next week.

stweil commented 6 days ago

Thanks for all your work on TYPO3 12.