Closed BFallert closed 1 month ago
Thanks for you report!
I will investigate the problem and write you back.
I have made research and found out that error comes from Kitodo.Presentation (https://github.com/kitodo/kitodo-presentation/blob/63df5ebf49754a0bf9d4a0926f9398e573033b04/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php#L94).
Variable $this->configurationManager
is null
and this is the reason for the error. There must be a problem with DI in this class as this parameter should be set by the function injectConfigurationManager
(https://github.com/kitodo/kitodo-presentation/blob/63df5ebf49754a0bf9d4a0926f9398e573033b04/Classes/ExpressionLanguage/DocumentTypeFunctionProvider.php#L66).
If I add the following code before line 94, part of the error message is gone and I can at least see the annual overview:
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\Extbase\\Object\\ObjectManager');
$configurationManager = $objectManager->get('TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager');
$this->injectConfigurationManager($configurationManager);
Only the following error messages remain:
Fri, 17 Nov 2023 13:46:19 +0100 [WARNING] request="68bf29cc8b02b" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: A non-numeric value encountered in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/Expression/MathExpressionNode.php line 80
Fri, 17 Nov 2023 13:46:19 +0100 [WARNING] request="68bf29cc8b02b" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: A non-numeric value encountered in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/Expression/MathExpressionNode.php line 80
When i click on a year, i get a new error message, but i open a new issue for it. (https://github.com/kitodo/kitodo-presentation/issues/1105)
The new error message is:
Fatal error: Uncaught TypeError: Argument 1 passed to Kitodo\Dlf\Controller\CalendarController::getIssuesFromDocuments() must be of the type array, object given, called in /var/www/typo3/packages/bfallert/presentation/Classes/Controller/CalendarController.php on line 439 and defined in /var/www/typo3/packages/bfallert/presentation/Classes/Controller/CalendarController.php:489 Stack trace: #0 /var/www/typo3/packages/bfallert/presentation/Classes/Controller/CalendarController.php(439): Kitodo\Dlf\Controller\CalendarController->getIssuesFromDocuments() #1 /var/www/typo3/packages/bfallert/presentation/Classes/Controller/CalendarController.php(400): Kitodo\Dlf\Controller\CalendarController->getIssues() #2 /var/www/typo3/packages/bfallert/presentation/Classes/Controller/CalendarController.php(362): Kitodo\Dlf\Controller\CalendarController->getIssuesByYear() #3 /var/www/typo3/packages/bfallert/presentation/Classes/Controller/CalendarController.php(115): Kitodo\Dlf\Controller\CalendarController->buildCalendar() #4 /var/www/typo3/ in /var/www/typo3/packages/bfallert/presentation/Classes/Controller/CalendarController.php on line 489
I have now tried this too. I have the same errors in the log except for the MathExpressionNode, which must come from somewhere else.
After adding the workaround lines and removing the type from the attribute the calendar works again.
I think we should open a issue in presentation.
Thank you both very much for this work!
I have now opened https://github.com/kitodo/kitodo-presentation/pull/1109 basing on the suggestions found here and in https://github.com/kitodo/kitodo-presentation/issues/1105.
@beatrycze-volk Some of the messages are still available. Should I open a new issue for this?
Fri, 17 Nov 2023 13:46:19 +0100 [WARNING] request="68bf29cc8b02b" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: A non-numeric value encountered in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/Expression/MathExpressionNode.php line 80
Fri, 17 Nov 2023 13:46:19 +0100 [WARNING] request="68bf29cc8b02b" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: A non-numeric value encountered in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/Expression/MathExpressionNode.php line 80
Unfortunately, you cannot see which code is causing this message
@beatrycze-volk Some of the messages are still available. Should I open a new issue for this?
Fri, 17 Nov 2023 13:46:19 +0100 [WARNING] request="68bf29cc8b02b" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: A non-numeric value encountered in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/Expression/MathExpressionNode.php line 80 Fri, 17 Nov 2023 13:46:19 +0100 [WARNING] request="68bf29cc8b02b" component="TYPO3.CMS.Core.Error.ErrorHandler": Core: Error handler (FE): PHP Warning: A non-numeric value encountered in /var/www/typo3/vendor/typo3fluid/fluid/src/Core/Parser/SyntaxTree/Expression/MathExpressionNode.php line 80
Unfortunately, you cannot see which code is causing this message
Yes, as this is different error message than the one which was described in this issue.
@BFallert we have found the reason for those errors in two places:
https://github.com/kitodo/kitodo-presentation/pull/1143 https://github.com/kitodo/kitodo-presentation/pull/1148
Hopefully it also fixes the problem for you :)
Unfortunately, I still have the error in my error log
Could you show me URL with which you are getting this error?
At first I was unable to reproduce this error message exactly. After several tests, I have now found the pattern with which I can reliably cause the error message. When I call a url for a document for the first time, or the page is reloaded hard, i.e. shift reload, then I get the message. This is independent of whether the page is called up or hard reloaded in single page or double page view, with full text switched on or in GridView. https://playground.bib.uni-mannheim.de/werksansicht/daa/1539/2/double-0/pagegrid-0 (This URL is currently not working externally, so I could limit the error messages to my calls only. If necessary, I can open it again. The URL is also not yet stable as I am still working on the "route enhancers".)
Could you check if this problem still exists for you? I have tested this functionality on my instance this week and the error was solved.
I updated my installation this morning and the problem has disappeared. So we can close the issue.
In my installation, I use the DFG viewer for the page view, but currently I do not get a calendar view for newspapers. However, the following messages appear in the error log:
I have entered the settings in dfg-viewer/Configuration/TypoScript/Plugins/kitodo.typoscript
The error only occurs when I call up a DFG viewer page of a newspaper. This error message does not occur on pages that are called up in the Presentation Viewer environment.
Instead of a calendar display (as desired), only a normal DFG Viewer page is displayed.