more php 7 issues
rei-we opened this issue · 5 comments
Basis: Typo3 7.6.12, pt_extbase 2.2.0, pt_extlist 2.3.0, yag 4.1.2, yag Themepack mQuery 1.3.2 installed as clone from git (20.11.2016)
With php 5.6 it works, but very slow. The website was developed on a VM-Server.
Temp-Files were completely deleted befor every test.
The System environment check of Installtool however shows:
"PHP always_populate_raw_post_data is deprecated
always_populate_raw_post_data=0
PHP is configured to automatically populate $HTTP_RAW_POST_DATA.
Warning: Expect fatal errors in central parts of the CMS if the value is not changed to:
always_populate_raw_post_data=-1"
With php.ini and .htcaccess I couldn't achieve any change.
I want to use php 7 (php 7.0.12), because obviouly quicker and longterm. But:
The Plugin as Contentelement in BE shows Error-Message (before and after Patches):
- "Bei dem Versuch, die Elemente für Feld "Motiv" (PHP Warning: Declaration of Tx_PtExtbase_Registry_Registry::addItem($object, $label, $overwrite = false) should be compatible with Tx_PtExtbase_Collection_Collection::addItem($itemObj, $id = 0) in /homepages/46/d655240018/htdocs/typo3/typo3conf/ext/pt_extbase/Classes/Registry/Registry.php line 33) zu verarbeiten, ist ein Fehler aufgetreten."
The dropdownfield 'Motiv' is empty.
The Modul 'Galerie' produces following error:
"#1289386765: Could not analyse class: "Tx_Yag_ViewHelpers_Link_GalleryViewHelper" maybe not loaded or no autoloader?
PHP Warning: Declaration of Tx_PtExtlist_ViewHelpers_Link_ActionViewHelper::render($action = NULL, array $arguments = Array, $controller = NULL, $extensionName = NULL, $pluginName = NULL, $pageUid = NULL, $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $format = '', $linkAccessRestrictedPages = false, array $additionalParams = Array, $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = Array) should be compatible with TYPO3\CMS\Fluid\ViewHelpers\Link\ActionViewHelper::render($action = NULL, array $arguments = Array, $controller = NULL, $extensionName = NULL, $pluginName = NULL, $pageUid = NULL, $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $format = '', $linkAccessRestrictedPages = false, array $additionalParams = Array, $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = Array, $addQueryStringMethod = NULL) in /homepages/46/d655240018/htdocs/typo3/typo3conf/ext/pt_extlist/Classes/ViewHelpers/Link/ActionViewHelper.php line 83 (More information)TYPO3\CMS\Extbase\Object\Container\Exception\UnknownObjectException thrown in file
/homepages/46/d655240018/htdocs/typo3_src-7.6.12/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php in line 37."
After using the patch from dmnk (another php 7 interface / yag problem #20) in principal I get the same error, just modified:
"#1289386765: Could not analyse class: "Tx_Yag_ViewHelpers_Link_GalleryViewHelper" maybe not loaded or no autoloader? PHP Warning: Declaration of Tx_Yag_ViewHelpers_Link_GalleryViewHelper::render($galleryUid = NULL, Tx_Yag_Domain_Model_Gallery $gallery = NULL, $pageUid = NULL, $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $format = '') should be compatible with Tx_PtExtlist_ViewHelpers_Link_ActionViewHelper::render($action = NULL, array $arguments = Array, $controller = NULL, $extensionName = NULL, $pluginName = NULL, $pageUid = NULL, $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $format = '', $linkAccessRestrictedPages = false, array $additionalParams = Array, $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = Array, $addQueryStringMethod = NULL) in /homepages/46/d655240018/htdocs/typo3/typo3conf/ext/yag/Classes/ViewHelpers/Link/GalleryViewHelper.php line 32 (More information)
TYPO3\CMS\Extbase\Object\Container\Exception\UnknownObjectException thrown in file
/homepages/46/d655240018/htdocs/typo3_src-7.6.12/typo3/sysext/extbase/Classes/Object/Container/ClassInfoFactory.php in line 37."
In the Typo3 Wiki to Exception/CMS/1289386765 I find many suggestions. I can't really use any of them but newinstall and delete temp-files. My guess is, that 'If you got the error while migrating your extension to use namespaces' is the relevant one. But what should I use as 'myvendorname'?
I can't believe, that such a fantastic extension can't run with php 7.
I used DL as vendorname to get rid of some issues. But the problem with missing arguments in Tx_Yag_ViewHelpers_Link_GalleryViewHelper remains the same.
Declaring the render-function with the same arguments as in Tx_PtExtlist_ViewHelpers_Link_ActionViewHelper
public function render($action = null, array $arguments = array(), $controller = null, $extensionName = null, $pluginName = null, $pageUid = null, $pageType = 0, $noCache = false, $noCacheHash = false, $section = '', $format = '', $linkAccessRestrictedPages = false, array $additionalParams = array(), $absolute = false, $addQueryString = false, array $argumentsToBeExcludedFromQueryString = array(), $addQueryStringMethod = NULL)
and init the additional arguments like
public function initializeArguments() {
$this->registerArgument('galleryUid', 'int',
'UID of album to render link for', false);
$this->registerArgument('gallery', 'Tx_Yag_Domain_Model_Gallery',
'Album object to render link for', false);
}
solves this issue.
Erfolgreich für das FE. Im BE wird aber weiterhin bei dem YAG-Plugin kein Motiv angezeigt. Fehlermeldung:
- Bei dem Versuch, die Elemente für Feld "Motiv" (PHP Warning: Declaration of Tx_PtExtbase_Registry_Registry::addItem($object, $label, $overwrite = false) should be compatible with PunktDe\PtExtbase\Collection\Collection::addItem($itemObj, $id = 0) in /homepages/46/d655240018/htdocs/typo3/typo3conf/ext/pt_extbase/Classes/Registry/Registry.php line 33) zu verarbeiten, ist ein Fehler aufgetreten.
Muss auch in der yag_themepack_jquery die GalleriaViewHelper.php angepasst werden?
I had to change a lot to get YAG working in t3 v8. You can see the changes in my pull-request for yag/pt_extlist and pt_extbase or in my forked projects: https://github.com/kiwi2101
It is working in my context but needs some more cleaning up. Hope it leads you to the right direction.