Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix deprecation warning (PHP 8.1+) #39881

Merged
merged 1 commit into from
Feb 17, 2023
Merged

Conversation

janschoenherr
Copy link
Contributor

@janschoenherr janschoenherr commented Feb 17, 2023

Fix deprecation warning with PHP 8.1+

Summary of Changes

If a replacement string is used, but no 'quicktask' is defined $params->get('menu-quicktask') will return null which triggers:

Deprecated: str_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in administrator/components/com_menus/src/Helper/MenusHelper.php on line 894

Actual result BEFORE applying this Pull Request

deprecation warning with PHP 8.1+

Expected result AFTER applying this Pull Request

No deprecation warning with PHP 8.1+

Link to documentations

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

Fix deprecation warning with PHP 8.1+

If a replacement string is used, but no 'quicktask' is defined `$params->get('menu-quicktask')` will return `null` which is deprecated in PHP 8.1+.

Deprecated: str_replace(): Passing null to parameter joomla#3 ($subject) of type array|string is deprecated in administrator/components/com_menus/src/Helper/MenusHelper.php on line 894
@joomdonation
Copy link
Contributor

I have tested this item ✅ successfully on 5587796

Code review !


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39881.

@alikon alikon added the PHP 8.x PHP 8.x deprecated issues label Feb 17, 2023
@alikon
Copy link
Contributor

alikon commented Feb 17, 2023

I have tested this item ✅ successfully on 5587796


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39881.

@Quy Quy removed the PHP 8.x PHP 8.x deprecated issues label Feb 17, 2023
@Quy
Copy link
Contributor

Quy commented Feb 17, 2023

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/39881.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Feb 17, 2023
@richard67 richard67 added the PHP 8.x PHP 8.x deprecated issues label Feb 17, 2023
@wilsonge wilsonge merged commit 39061fa into joomla:4.2-dev Feb 17, 2023
@wilsonge wilsonge added this to the Joomla! 4.2.9 milestone Feb 17, 2023
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Feb 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP 8.x PHP 8.x deprecated issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants