PHP Catchable Fatal Error: Argument 3 passed to ...
#1: PHP Catchable Fatal Error: Argument 3 passed to TYPO3\CMS\Frontend\Page\PageRepository::getFileReferences() must be of the type array, null given, called in typo3_src/typo3_src-6.2.4/typo3/sysext/frontend/Classes/ContentObject /FilesContentObject.php on line 317 and defined in typo3_src/typo3_src-6.2.4/typo3/sysext/frontend/Classes/Page/PageRepository.php line 1357
This error message comes with Typo3 6.2.x and cal 1.6.0 in the Event-View on a Event with an Image (ts_standard).
#1 Updated by Markus Gilli about 5 years ago
Same here but the patch doesn't fix the problem.
Found that the problem commes with this patch:
It looks like the "getRecordOverlay" function returns null instead of an element.
#3 Updated by Stephan Lindner almost 5 years ago
I have the same problem (Typo3.6.5 and cal 1.6.0) and yet no solution, but maybe my observation helps somebody else to fix the problem:
In the file FilesContentObject.php in the function handelFileReference in line 293 the function $pageRepository->getRawRecord is called (which is in the file sysext/frontend/Classes/Page/PageRepository.php). After this call the array element is empty.
The function rawRecord tries to find the record of the table tx_cal_event, but looks in the table tt_content. Because in my database the record in tt_content with the same uid as the record in tx_cal_events is deleted, the function returns an empty array. With other events, which uid does not correspond with a deleted record in tt_content, everything works fine.
tt_content is used, because in the function handleFileReferences line 284 the tablename is initalized with $this->cObj->getCurrentTable(), which returns tt_content.
#5 Updated by Marc Wöhlken almost 5 years ago
Tested the current (7th of October) trunk version of cal, did not fix the problem for me.
Error message is still:
PHP Catchable Fatal Error: Argument 3 passed to TYPO3\CMS\Frontend\Page\PageRepository::getFileReferences() must be an array, null given, called in /var/www/typo3/typo3_src/typo3_src-6.2.5/typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php
#7 Updated by Jan Kranefeld almost 5 years ago
The new version doesn't work here (TYPO3 6.2.5, cal 1.7.0, all caches/typo3temp folder cleared)
I get the same error message as before:
#1: PHP Catchable Fatal Error: Argument 3 passed to TYPO3\CMS\Frontend\Page\PageRepository::getFileReferences() must be an array, null given, called in /var/www/typo3_src-6.2.5/typo3/sysext/frontend/Classes/ContentObject/FilesContentObject.php on line 317 and defined in /var/www/typo3_src-6.2.5/typo3/sysext/frontend/Classes/Page/PageRepository.php line 1357
I've dug around a little and it seems that in model/class.tx_cal_phpicalendar_model.php the value in $this->conf ['view.'] [$view . '.'] ['event.'] ['attachment']) is not resolved but instead passed as a string literal. It contains "< tt_content.uploads" and is passed two times to TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::cObjGetSingle:
$sims ['###ATTACHMENT###'] = $this->local_cObj->cObjGetSingle ($this->conf ['view.'] [$view . '.'] ['event.'] ['attachment'], $this->conf ['view.'] [$view . '.'] ['event.'] ['attachment.']);
Since the second parameter of this function is expected to be an array, I think that the error occurrs here.
Any opinions on that?
#10 Updated by Pascal Querner over 4 years ago
Hello fellow devs,
I am in the process of updating a T3 4.5.x website to 6.2.x and it was using a quite old cal version.
In the process of updateting cal to its newest version I encoutered this problem, too.
For me it was some old typoscript which wasnt ready for FAL.
So: check your TS setup when updating this extension!