User tests: Successful: Unsuccessful:
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 # .
Added array_unique before returning values
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
There could be duplicates
There can not be duplicates
No
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Labels |
Added:
?
|
I have tested this item
Status | Pending | ⇒ | Ready to Commit |
RTC
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:
?
|
Thx
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.