humhub / linkpreview-issues

Issue Tracker for LinkPreview module
2 stars 1 forks source link

Error with PHP 8.1 and error_reporting(E_ALL) #32

Open marc-farre opened 1 year ago

marc-farre commented 1 year ago

If error_reporting is set to E_ALL, the previewing doesn't work. I didn't take time to investigate. Perhaps a composer update would solve the problem, the the composer.json is not present, so I cannot test.

Error log:

yii\base\ErrorException: During inheritance of IteratorAggregate: Uncaught yii\base\ErrorException: Return type of Fusonic\Linq\Linq::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/hhdev/protected/modulesnoncuzy/linkpreview/vendor/fusonic/linq/src/Fusonic/Linq/Linq.php:728
Stack trace:
#0 /var/www/hhdev/protected/modulesnoncuzy/linkpreview/vendor/fusonic/linq/src/Fusonic/Linq/Linq.php(36): yii\web\ErrorHandler->handleError(code: '...', message: '...', file: '...', line: '...')
#1 /var/www/hhdev/protected/vendor/composer/ClassLoader.php(571): ::unknown()
#2 /var/www/hhdev/protected/vendor/composer/ClassLoader.php(428): ::Composer\Autoload\includeFile(file: '...')
#3 /var/www/hhdev/protected/modulesnoncuzy/linkpreview/vendor/fusonic/opengraph/src/Consumer.php(101): Composer\Autoload\ClassLoader->loadClass(class: '...')
#4 /var/www/hhdev/protected/modulesnoncuzy/linkpreview/vendor/fusonic/opengraph/src/Consumer.php(79): Fusonic\OpenGraph\Consumer->extractOpenGraphData(content: '...')
#5 /var/www/hhdev/protected/modulesnoncuzy/linkpreview/controllers/IndexController.php(52): Fusonic\OpenGraph\Consumer->loadHtml(html: '...', fallbackUrl: '...')
#6 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): humhub\modules\linkpreview\controllers\IndexController->actionFetch()
#7 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/var/www/hhdev/protected/vendor/yiisoft/yii2/base/InlineAction.php:57}(callback: '...', args: '...')
#8 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(params: '...')
#9 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/Module.php(552): humhub\modules\linkpreview\controllers\IndexController->runAction(id: '...', params: '...')
#10 /var/www/hhdev/protected/vendor/yiisoft/yii2/web/Application.php(103): humhub\components\Application->runAction(route: '...', params: '...')
#11 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/Application.php(384): humhub\components\Application->handleRequest(request: '...')
#12 /var/www/hhdev/index.php(26): humhub\components\Application->run()
#13 {main} in /var/www/hhdev/protected/modulesnoncuzy/linkpreview/vendor/fusonic/linq/src/Fusonic/Linq/Linq.php:36
Stack trace:
#0 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/ErrorHandler.php(0): yii\web\ErrorHandler->handleFatalError()
#1 /var/www/hhdev/protected/vendor/composer/ClassLoader.php(571): ::unknown()
#2 /var/www/hhdev/protected/vendor/composer/ClassLoader.php(428): ::Composer\Autoload\includeFile(file: '...')
#3 /var/www/hhdev/protected/modulesnoncuzy/linkpreview/vendor/fusonic/opengraph/src/Consumer.php(101): Composer\Autoload\ClassLoader->loadClass(class: '...')
#4 /var/www/hhdev/protected/modulesnoncuzy/linkpreview/vendor/fusonic/opengraph/src/Consumer.php(79): Fusonic\OpenGraph\Consumer->extractOpenGraphData(content: '...')
#5 /var/www/hhdev/protected/modulesnoncuzy/linkpreview/controllers/IndexController.php(52): Fusonic\OpenGraph\Consumer->loadHtml(html: '...', fallbackUrl: '...')
#6 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): humhub\modules\linkpreview\controllers\IndexController->actionFetch()
#7 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/InlineAction.php(57): ::call_user_func_array:{/var/www/hhdev/protected/vendor/yiisoft/yii2/base/InlineAction.php:57}(callback: '...', args: '...')
#8 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(params: '...')
#9 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/Module.php(552): humhub\modules\linkpreview\controllers\IndexController->runAction(id: '...', params: '...')
#10 /var/www/hhdev/protected/vendor/yiisoft/yii2/web/Application.php(103): humhub\components\Application->runAction(route: '...', params: '...')
#11 /var/www/hhdev/protected/vendor/yiisoft/yii2/base/Application.php(384): humhub\components\Application->handleRequest(request: '...')
#12 /var/www/hhdev/index.php(26): humhub\components\Application->run()
#13 {main}
luke- commented 1 year ago

@funkycram Seems there is an problem with PHP 8.1 in an underlying extension. We need to refacor the module here.