- Issue created by @petednz
- Assigned to Grevil
- 🇩🇪Germany Anybody Porta Westfalica
Thanks @petednz, I guess the issue is your PHP version.
The affected line is:
public static function filterByPage(Sql $query, MenuLinkContent|NULL $link)
and the |NULL type declaration isn't supported by your PHP version. Which one are you using?
This is a bug in the module, as the module doesn't define a minimum PHP version.
But instead of introducing such a limitation, I'd suggest to check if we can't simply usepublic static function filterByPage(Sql $query, MenuLinkContent $link = NULL)
here instead with the same results.
BTW @Grevil shouldn't it be
public static function filterByPage(Sql $query, ?MenuLinkContent $link)
also in latest PHP versions?
Is the |NULL syntax correct anyway? I guess that's only for comments?
Please also check all other parts of the code for this issue.
Thanks :)
- 🇳🇿New Zealand petednz
Many thanks for prompt response
PHP config : /etc/php/7.4/cli/php.ini
- 🇩🇪Germany Grevil
Whoops, sry NULL is generally wrong for variable typing. As @Anybody correctly said it should be
?MenuLinkContent $link
, which is compatible with php 7.1.MenuLinkContent|NULL
is even wrong for php 8.0 where this kind of typing (Union Types) got introduced. The correct Syntax would beMenuLinkContent|null
instead for php 8 (or ?MenuLinkContent). - Status changed to Needs review
over 1 year ago 3:12pm 9 March 2023 - @grevil opened merge request.
- Issue was unassigned.
- Status changed to RTBC
over 1 year ago 4:36pm 9 March 2023 - 🇩🇪Germany Anybody Porta Westfalica
Thanks @Grevil! Nullable types were introduced with PHP 7.1 so this should be fine. I'll tag a new release.
https://www.php.net/manual/en/migration71.new-features.php@petednz could you please confirm it works now?
- Status changed to Fixed
over 1 year ago 4:40pm 9 March 2023 - 🇳🇿New Zealand petednz
many thanks for your prompt attention to this. much appreciated
Automatically closed - issue fixed for 2 weeks with no activity.