?
avatar SharkyKZ
SharkyKZ
5 Oct 2020

FoF has an error on PHP 8 caused by incompatible function signature:

public static function render($layoutFile, $displayData = null, $basePath = '')

public static function render($layoutFile, $displayData = null, $basePath = '', $options = null)

If we add the missing argument, this fixes the error for us but classes extending FOFLayoutHelper remain broken unless they add it as well.

Another option is to break class inheritance and inline Joomla\CMS\Layout\LayoutHelper into FOFLayoutHelper. It's technically a B/C break but should be less painful.

avatar SharkyKZ SharkyKZ - open - 5 Oct 2020
avatar joomla-cms-bot joomla-cms-bot - change - 5 Oct 2020
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 5 Oct 2020
avatar HLeithner
HLeithner - comment - 5 Oct 2020

Adding the parameter would be the proper way but since our FOF version is deprecated anyway and people have to migrate way from it (native or new version) it seems better for j3 to inline the debug function and remove the inheritance

avatar SharkyKZ
SharkyKZ - comment - 5 Oct 2020

Looking more into it, inlining could be problematic because of static $defaultBasePath property.

avatar HLeithner
HLeithner - comment - 5 Oct 2020

hmm that's true so we have to extend the parameter, it also is only a problem for extensions want to support php8 correct?

avatar SharkyKZ
SharkyKZ - comment - 5 Oct 2020

It causes an error only on PHP 8. On older versions it emits either a warning or strict standards notice.

avatar SharkyKZ SharkyKZ - change - 5 Oct 2020
Status New Closed
Closed_Date 0000-00-00 00:00:00 2020-10-05 07:23:00
Closed_By SharkyKZ
avatar SharkyKZ
SharkyKZ - comment - 5 Oct 2020

Closing as having Pull Request #30922.

avatar SharkyKZ SharkyKZ - close - 5 Oct 2020

Add a Comment

Login with GitHub to post a comment