? ? Pending

User tests: Successful: Unsuccessful:

avatar aDaneInSpain
aDaneInSpain
27 Dec 2021

I stumbled over this on a site I was debugging. The system sends the following query:

SELECT `folder` AS `type`,`element` AS `name`,`params` AS `params`,`extension_id` AS `id`

  FROM #__extensions

  WHERE enabled = 1 
  AND type = 'plugin' 
  AND state IN (0,1) 
  AND access IN (1,1,5)

  ORDER BY ordering

Notice the AND access IN (1,1,5) the extra 1 comes from the fact that this method hardcodes the 1 on line 1027 and then later also finds in the database. This does not really break anything but is just proper data management. For instance if someone wanted to count how many groups have access to something and used this method and counted the entries would get the answer 3 and not 2. It also leads to "wasted" time with developers who are curious where this comes from and spends time hunting down the source.

Pull Request for Issue # .

Summary of Changes

Added array_unique before returning values

Testing Instructions

Not totally sure how to test this as I am sure this method is called many many places. But if you enable debug and look at executed queries and find one that starts with:

SELECT `folder` AS `type`,`element` AS `name`,`params` AS `params`,`extension_id` AS `id`

Then ensure the parenthesis in ACCESS IN statement only has unique values

Actual result BEFORE applying this Pull Request

There could be duplicates

Expected result AFTER applying this Pull Request

There can not be duplicates

Documentation Changes Required

No

avatar aDaneInSpain aDaneInSpain - open - 27 Dec 2021
avatar aDaneInSpain aDaneInSpain - change - 27 Dec 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 27 Dec 2021
Category Libraries
avatar aDaneInSpain aDaneInSpain - change - 27 Dec 2021
The description was changed
avatar aDaneInSpain aDaneInSpain - change - 27 Dec 2021
Labels Added: ?
avatar Quy
Quy - comment - 10 Jan 2022

I have tested this item successfully on 474b76c


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

avatar Quy Quy - test_item - 10 Jan 2022 - Tested successfully
avatar dgrammatiko
dgrammatiko - comment - 11 Jan 2022

I have tested this item successfully on 474b76c


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

avatar dgrammatiko dgrammatiko - test_item - 11 Jan 2022 - Tested successfully
avatar richard67 richard67 - change - 11 Jan 2022
Status Pending Ready to Commit
avatar richard67
richard67 - comment - 11 Jan 2022

RTC


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

avatar bembelimen bembelimen - change - 21 Jan 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-01-21 13:02:04
Closed_By bembelimen
Labels Added: ?
avatar bembelimen bembelimen - close - 21 Jan 2022
avatar bembelimen bembelimen - merge - 21 Jan 2022
avatar bembelimen
bembelimen - comment - 21 Jan 2022

Thx

Add a Comment

Login with GitHub to post a comment