bug PR-5.4-dev Pending

User tests: Successful: Unsuccessful:

avatar Fedik
Fedik
12 Sep 2024

Pull Request for Issue #44056.

Summary of Changes

Fix Toolbar access check when the content is filtered by multiple categories.

Testing Instructions

Code review, for now.
The ContentHelper::getActions() expecting an ID

public static function getActions($component = '', $section = '', $id = 0)

Actual result BEFORE applying this Pull Request

ContentHelper::getActions() recieving an array of IDs

Expected result AFTER applying this Pull Request

ContentHelper::getActions() recieving single ID

Link to documentations

Please select:

  • 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
avatar Fedik Fedik - open - 12 Sep 2024
avatar Fedik Fedik - change - 12 Sep 2024
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 12 Sep 2024
Category Administration com_contact com_content
0677b87 13 Sep 2024 avatar Fedik typo
avatar Fedik Fedik - change - 13 Sep 2024
Labels Added: bug PR-4.4-dev
a2e0401 13 Sep 2024 avatar Fedik typo
avatar Fedik Fedik - change - 13 Sep 2024
Title
Fix Toolbar access check when the content is filtered by multiple categories
[4.4] Fix Toolbar access check when the content is filtered by multiple categories
avatar Fedik Fedik - edited - 13 Sep 2024
avatar HLeithner
HLeithner - comment - 15 Nov 2024

This pull request has been automatically rebased to 5.2-dev.

avatar HLeithner HLeithner - change - 15 Nov 2024
Title
[4.4] Fix Toolbar access check when the content is filtered by multiple categories
[5.2] Fix Toolbar access check when the content is filtered by multiple categories
avatar HLeithner HLeithner - edited - 15 Nov 2024
avatar Hackwar Hackwar - change - 16 Jan 2025
Labels Added: PR-5.2-dev
avatar Hackwar
Hackwar - comment - 17 Jan 2025

@Fedik Can you fix the codestyle issues?

74bfe1b 18 Jan 2025 avatar Fedik cs
avatar HLeithner
HLeithner - comment - 15 Apr 2025

This pull request has been automatically rebased to 5.3-dev.

avatar HLeithner HLeithner - change - 15 Apr 2025
Title
[5.2] Fix Toolbar access check when the content is filtered by multiple categories
[5.3] Fix Toolbar access check when the content is filtered by multiple categories
avatar HLeithner HLeithner - edited - 15 Apr 2025
avatar HLeithner
HLeithner - comment - 15 Oct 2025

This pull request has been automatically rebased to 5.4-dev.

avatar Fedik Fedik - change - 19 Oct 2025
Title
[5.3] Fix Toolbar access check when the content is filtered by multiple categories
[5.4] Fix Toolbar access check when the content is filtered by multiple categories
avatar Fedik Fedik - edited - 19 Oct 2025
avatar richard67 richard67 - change - 20 Oct 2025
Labels Added: PR-5.4-dev
Removed: PR-4.4-dev PR-5.2-dev
avatar brianteeman
brianteeman - comment - 2 May 2026

Can you please supply some testing instructions which explain/show how to see the access check failure. Without that I fear this PR will sit untested for another year

avatar Fedik
Fedik - comment - 3 May 2026

This is something that should be obvious for maintainers.

1-2 review from mainteiners should be good enough to merge this pr.

Setting up the test case for general testing will take more time than it deserves.

avatar joomdonation
joomdonation - comment - 3 May 2026

I think the following testing instructions would work:

  1. Edit an article category, look at Permissions tab, select Administrator user group, set Create permission to Denied. That will prevent users from Administrator user group has permission to create articles for that category
  2. Login to administrator area of the site using an Administrator account (not super user account)
  3. Access to Articles Management screen. In categories filter dropdown, select the article above. The New button in the toolbar should not be displayed because user does not have permission to create article for that category. At the moment, the New button still being displayed. You can try to create a new article and assign it to that category, but it could not be saved.
  4. Apply patch, and after that, the New button in the toolbar won't be displayed as expected since the user does not have permission to create article for the category
avatar LadySolveig
LadySolveig - comment - 3 May 2026

@Fedik but the or condition will still be true and the button will be still shown.
Does it really make sense to check it here at all or am I missing something?

https://github.com/Fedik/joomla-cms/blob/4833fecb7afc12468ad0e704c8bb6b5eab37241b/administrator/components/com_content/src/View/Articles/HtmlView.php#L188

avatar LadySolveig
LadySolveig - comment - 3 May 2026

@Fedik but the or condition will still be true and the button will be still shown.
Does it really make sense to check it here at all or am I missing something?

It would only be hidden if the user has no permissions at the core level and has only been explicitly granted permissions for specific categories. Is that what is intended? Than is works :)

https://github.com/Fedik/joomla-cms/blob/4833fecb7afc12468ad0e704c8bb6b5eab37241b/administrator/components/com_content/src/View/Articles/HtmlView.php#L188

Add a Comment

Login with GitHub to post a comment