? PHP 8.x ? Pending

User tests: Successful: Unsuccessful:

avatar OctavianC
OctavianC
24 Nov 2022

Testing Instructions

  • Switch to PHP 8.1 and set Error Reporting to Maximum
  • Go to Users > Access Levels > click New

Actual result BEFORE applying this Pull Request

Deprecated warning showing up
image

Expected result AFTER applying this Pull Request

No warnings
image

avatar OctavianC OctavianC - open - 24 Nov 2022
avatar OctavianC OctavianC - change - 24 Nov 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 24 Nov 2022
Category Administration com_users
avatar alikon
alikon - comment - 24 Nov 2022

see #38467 too

avatar richard67
richard67 - comment - 24 Nov 2022

So we have 2 PRs for the same issue, this one and #38467 . While this here changes $result->rules to an empty array when it is null, the other one leaves it as it is and just doesn't try to decode it. I'm not sure what's better, but I tend to think the other PR is better.

avatar nibra
nibra - comment - 26 Nov 2022

Most simple solution:

$result->rules = json_decode($result->rules ?? '{}');

since $result->rules is expected to be an array afterwards.

avatar HLeithner
HLeithner - comment - 26 Nov 2022

And non of the solutions documents why this value could be empty.

avatar joomdonation joomdonation - test_item - 8 Jan 2023 - Tested successfully
avatar joomdonation
joomdonation - comment - 8 Jan 2023

I have tested this item successfully on 4be4e9d


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

avatar joomdonation
joomdonation - comment - 8 Jan 2023

And non of the solutions documents why this value could be empty.

It is null because when we create a new level, getItem() method from AdminModel just return an object of that item with all fields from that table set to null. For reference :

avatar alikon alikon - test_item - 8 Jan 2023 - Tested successfully
avatar alikon
alikon - comment - 8 Jan 2023

I have tested this item successfully on 4be4e9d


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

avatar richard67 richard67 - change - 8 Jan 2023
Status Pending Ready to Commit
Labels Added: ? PHP 8.x
avatar richard67
richard67 - comment - 8 Jan 2023

RTC


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

avatar fancyFranci fancyFranci - change - 8 Jan 2023
Labels Added: ?
avatar fancyFranci fancyFranci - close - 8 Jan 2023
avatar fancyFranci fancyFranci - merge - 8 Jan 2023
avatar fancyFranci fancyFranci - change - 8 Jan 2023
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2023-01-08 12:59:47
Closed_By fancyFranci
avatar fancyFranci
fancyFranci - comment - 8 Jan 2023

Thanks, everybody

Add a Comment

Login with GitHub to post a comment