? Pending

User tests: Successful: Unsuccessful:

avatar eopws
eopws
22 Apr 2021

Summary of Changes

if block replaced with null coalescing operator to reduce code and make it more readable.

Testing Instructions

Go to administrator/components/com_plugins/src/Model/PluginsModel.php

avatar eopws eopws - open - 22 Apr 2021
avatar eopws eopws - change - 22 Apr 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 22 Apr 2021
Category Administration com_plugins
avatar richard67
richard67 - comment - 22 Apr 2021

I don't think this is right. The null coalesce operator returns the first value if it exists and is not null, otherwise the second operator. An empty string is not null, i.e. with this change here, the empty string will be used.

avatar richard67
richard67 - comment - 22 Apr 2021

Another question is if this PR is right, then why is it made for the 4.1-dev branch? The same code exists also in the 4.0-dev branch, where we also could use null coalesce. Only in J3 we can't use it due to minimum version requirement for PHP being not high enough.

avatar eopws
eopws - comment - 22 Apr 2021

I don't think this is right. The null coalesce operator returns the first value if it exists and is not null, otherwise the second operator. An empty string is not null, i.e. with this change here, the empty string will be used.

I think that's right. Sorry for disturbing. I will close the pull request

avatar eopws eopws - change - 22 Apr 2021
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2021-04-22 17:39:39
Closed_By eopws
Labels Added: ?
avatar eopws eopws - close - 22 Apr 2021

Add a Comment

Login with GitHub to post a comment