heimrichhannot / contao-news-pagination-bundle

Automatic or manual content pagination for news or other content in contao.
Other
2 stars 1 forks source link

Instalerror with php 7.2.15 #2

Closed harley-rider closed 4 years ago

harley-rider commented 5 years ago

I got this error with adding the bundle to cto 4.4.35

Fatal error: Cannot use Riak\Object as Object because 'Object' is a special class name in I:\xampp-7-2-15-2-x64\htdocs\contao-4-4-lts\hr-vision\vendor\doctrine\cache\lib\Doctrine\Common\Cache\RiakCache.php on line 8 PHP Fatal error: Cannot use Riak\Object as Object because 'Object' is a special class name in I:\xampp-7-2-15-2-x64\htdocs\contao-4-4-lts\hr-vision\vendor\doctrine\cache\lib\Doctrine\Common\Cache\RiakCache.php on line 8 Script Contao\ManagerBundle\Composer\ScriptHandler::initializeApplication handling the post-install-cmd event terminated with an exception

In ScriptHandler.php line 113: An error occurred while executing the "contao:install-web-dir" command: PHP
Fatal error: Cannot use Riak\Object as Object because 'Object' is a speci
al class name in I:\xampp-7-2-15-2-x64\htdocs\contao-4-4-lts\hr-vision\vend
or\doctrine\cache\lib\Doctrine\Common\Cache\RiakCache.php on line 8

Defcon0 commented 5 years ago

The error isn't related to this bundle but to the combination of Contao 4, PHP 7.2+ and Doctrine.

Nevertheless we provide a fix module for this. Just add it to your project's composer.json and the issue should be fixed for you:

https://github.com/heimrichhannot/contao-doctrine-cache-fix

harley-rider commented 5 years ago

Thanks What i have to do with the composer.json in this fix ? I've reinstalled a clean cto 4.4.35. When i add the code at the end of the existing file, CM won't start. Do i have first to install the bundle and afterwards something with the composer.json ?

Defcon0 commented 5 years ago

Maybe you just have to make yourself comfortable on how composer works. Composer as a package manager always takes into account a whole set of dependencies and resolves the resulting set of modules to be installed.

What you can try to do is:

Get a clean contao instance and configure it to the point you can do a composer update. After that add heimrichhannot/contao-doctrine-cache-fix in the latest version to your project's composer.json. Then you run composer update. If that succeeds, add contao-news-pagination-bundle also to your project's composer.json and run composer update again.

Of course until support for PHP 7.1 ends you can always go down to PHP 7.1. Here you won't have this problem.

fritzmg commented 5 years ago

Isn't this something that must be fixed in Doctrine instead?

Defcon0 commented 5 years ago

The needed fix doesn't seem to be pulled, yet:

https://github.com/basho/riak-php-client/issues/152

Hence we wrote the fix composer module for moving on with our development.

fritzmg commented 5 years ago

Hm, judging by the comments in the pull requests, the package seems to be somewhat abandoned.

koertho commented 4 years ago

If someone still has this error (but I think this was fixed in the meantime) install https://github.com/heimrichhannot/contao-doctrine-cache-fix to fix this issue.