gantry5
gantry5 copied to clipboard
Minor changes required for PHP 8.1 / Joomla 4.2.7 to avoid 'deprecated' warnings
Deprecated: Return type of Pimple\Container::offsetExists($id) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 133
Deprecated: Return type of Pimple\Container::offsetGet($id) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 98
Deprecated: Return type of Pimple\Container::offsetSet($id, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 79
Deprecated: Return type of Pimple\Container::offsetUnset($id) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /.../libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 143
I've just migrated my Gantry 5.5.15 site to Joomla 4.3.0 (from 3.10.11) and see similar (and more) deprecated errors with PHP 8.1.13:
Deprecated: Return type of Pimple\Container::offsetExists($id) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 133
Deprecated: Return type of Pimple\Container::offsetGet($id) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 98
Deprecated: Return type of Pimple\Container::offsetSet($id, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 79
Deprecated: Return type of Pimple\Container::offsetUnset($id) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 143
Deprecated: Return type of Twig\Node\Node::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/compat/vendor/twig/twig/src/Node/Node.php on line 213
Deprecated: Return type of Twig\Node\Node::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/compat/vendor/twig/twig/src/Node/Node.php on line 221
I can confirm that these errors are not shown with PHP 7.4.33, so that's my temporary workaround for now. Please advise when PHP 8 deprecation issues are likely to be fixed. Thanks.
@rjksmith Have you tried the v5.5.16 update yet? https://gantry.org/downloads#joomla
The auto update in Joomla has been disabled for now by @hexplor per his comment in this issue https://github.com/gantry/gantry5/issues/3138#issuecomment-1495565503 👈 (goes straight to his comment)
While I'm not part of the Gantry 5 team (Maybe I should be the way I reply to issues here, LOL!) I try to help out as much as possible, so please report back as to whether or not the v5.5.16 version fixes the issue you are experiencing.
I’m not part of the team, just a punter, but as a temporary workaround I used:
#[\ReturnTypeWillChange]
public function offsetExists($id)
at each of the offending functions, just to stop the warnings. (Found this with a Google search on the warning, seems to suffice for now.
The level of knowledge required to fix it properly is above me.)
Ken Waters
From: Rob Smith @.*** Sent: 21 April 2023 14:11 To: gantry/gantry5 Cc: wetken; Author Subject: Re: [gantry/gantry5] Minor changes required for PHP 8.1 / Joomla 4.2.7 to avoid 'deprecated' warnings (Issue #3115)
I've just migrated my Gantry 5.5.15 site to Joomla 4.3.0 (from 3.10.11) and see similar (and more) deprecated errors with PHP 8.1.13:
Deprecated: Return type of Pimple\Container::offsetExists($id) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 133
Deprecated: Return type of Pimple\Container::offsetGet($id) should either be compatible with ArrayAccess::offsetGet(mixed $offset): mixed, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 98
Deprecated: Return type of Pimple\Container::offsetSet($id, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 79
Deprecated: Return type of Pimple\Container::offsetUnset($id) should either be compatible with ArrayAccess::offsetUnset(mixed $offset): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/vendor/pimple/pimple/src/Pimple/Container.php on line 143
Deprecated: Return type of Twig\Node\Node::count() should either be compatible with Countable::count(): int, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/compat/vendor/twig/twig/src/Node/Node.php on line 213
Deprecated: Return type of Twig\Node\Node::getIterator() should either be compatible with IteratorAggregate::getIterator(): Traversable, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in ./public_html/libraries/gantry5/compat/vendor/twig/twig/src/Node/Node.php on line 221
I can confirm that these errors are not shown with PHP 7.4.33, so that's my temporary workaround for now. Please advise when PHP 8 deprecation issues are likely to be fixed. Thanks.
— Reply to this email directly, view it on GitHub https://github.com/gantry/gantry5/issues/3115#issuecomment-1517815687 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQCZXNFONIOVVJZ7IBERS3XCKBNZANCNFSM6AAAAAAUQONRWU . You are receiving this because you authored the thread.Image removed by sender.Message ID: @.***>
@wetken Did you try the v5.5.16 update available for download here: https://gantry.org/downloads#joomla ❓
No, I didn’t apply this simply because my Joomla control panel doesn’t offer it as a system upgrade, and I’m about to go live with my system and don’t want to do anything that might prejudice that.
Once it all settles I’ll build a sandbox and look at it again.
From: Michael Koontz @.*** Sent: 21 April 2023 16:10 To: gantry/gantry5 Cc: wetken; Mention Subject: Re: [gantry/gantry5] Minor changes required for PHP 8.1 / Joomla 4.2.7 to avoid 'deprecated' warnings (Issue #3115)
@wetken https://github.com/wetken Did you try the v5.5.16 update available for download here: https://gantry.org/downloads#joomla ❓
— Reply to this email directly, view it on GitHub https://github.com/gantry/gantry5/issues/3115#issuecomment-1517980267 , or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQCZXP2NDHKFDWNGYVENWTXCKPOBANCNFSM6AAAAAAUQONRWU . You are receiving this because you were mentioned.Image removed by sender.Message ID: @.***>
@wetken the reason it isn't showing up is because @hexplor has disabled the auto update in Joomla temporarily. It was supposed to be reactivated but he hasn't done it yet. You can see his comment in this other ticket here: https://github.com/gantry/gantry5/issues/3138#issuecomment-1495565503. So as of right now, the v5.5.16 release is considered a stable release, not a CI build. Keep it in mind going forward.
@N8Solutions I've downloaded Gantry and Helium 5.5.16 from gantry.org and can confirm that these installed without error for me on both my sites. I can also confirm that this has eliminated all the deprecated error messages with PHP 8.1.13 which is consistent with the change log notes. Many thanks for your help.
@wetken It looks as though installing 5.5.16 will resolve your issue.
@rjksmith Your welcome and thank you for commenting that the issue is resolved!