? Success

User tests: Successful: Unsuccessful:

avatar sanderpotjer
sanderpotjer
24 Dec 2013

Summary

This pull request improves the JHelperContent::getActions() and removes duplicate code from components using their own helper file for checking the available ACL actions.

Background

Originally I started to look into the bug reported in #32956 of JoomlaCode (http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32956&start=0). In that bug report the Save buttons in the toolbar are not visible when a user should be able to see them. This issue is related to pull request: #2049 where part of the Joomla getActions helpers per component are replaced by a general getActions helper.

The concept is nice, but results in several issues in Joomla 3.2 like buttons/parts not visible when a user should allow to see it.

Improvements

In this pull request I propose a change of the JHelperContent::getActions() function in libraries/cms/helper/content.php. Main improvements:

  • JHelperContent::getActions it is more flexible for implementation by 3rd part extension with their own ACL section names in the access.xml files of components, no longer limited to the structure of com_content
  • JHelperContent::getActions checks for all available actions for a component (all available ACL actions from a component should be listed in the "component" section of the access.xml file), not just the ones available for the specific section. This prevents issues in views where general component actions are used as well.

With the improvements made in the JHelperContent::getActions helper I could further implement this in Joomla:

  • replaced the left over extensions using their own getActions helper with the general JHelperContent::getActions helper
  • removed the getActions function from the component helper files
  • corrected the already implemented JHelperContent::getActions with the correct variables
  • reduced number of action checks in several components
  • removed unused getActions calls

Testing

Please apply this patch and test if:
a) reported Joomla 3.2 ACL issues are solved
b) configure permissions for user groups with specific access/actions allowed is working as expected.

Thanks for testing & checking! Sander

avatar sanderpotjer sanderpotjer - open - 24 Dec 2013
avatar chivitli
chivitli - comment - 25 Jan 2014
avatar asika32764
asika32764 - comment - 25 Jan 2014

:+1:

avatar sanderpotjer sanderpotjer - change - 28 Jan 2014
Title
JHelperContent::getActions() function improvements
[#33044] JHelperContent::getActions() function improvements
Labels Added: ? ?
avatar sanderpotjer
sanderpotjer - comment - 28 Jan 2014

@chivitli & @Bakual I have updated the pull request with backwards compatibility for getActions().

avatar Bakual
Bakual - comment - 28 Jan 2014

Saw a small codestyle issue. Otherwise I think code should be backward compatible from looking. Thanks!

However something seems to be wrong with your PR because there are many changes in language files which probably are not intended. You may want to have a look at that.

avatar sanderpotjer
sanderpotjer - comment - 28 Jan 2014

Thanks @Bakual! Hmm... looks like with rebasing the pull with the master these languages files are added. Going to check how I can solve this.

avatar sanderpotjer
sanderpotjer - comment - 28 Jan 2014

Ok, PR is is fixed now.

avatar Bakual
Bakual - comment - 28 Jan 2014

Looks indeed clean, good for testing now :smile: Thanks!

avatar chivitli
chivitli - comment - 28 Jan 2014

Do we need to retest it? If yes, I am having an issue with applying the patch file using tortoisegit, where it says "The filename 'libraries\cms\helper\content.php' appears more than once"

avatar chivitli
chivitli - comment - 30 Jan 2014

Finally managed to apply the refreshed patch, everything is still working fine. Do we need more tests on joomla code?

avatar chivitli
chivitli - comment - 2 Feb 2014

@Bakual

Is it possible to catch 3.2.2 window for this?

avatar Bakual
Bakual - comment - 2 Feb 2014

I think tests should be fine. Of course more tests never hurt.
In theory, it would still be possible for 3.2.2 since no language strings have changed.

@sanderpotjer PR looks to be outdated again, probably due to recent codestyle fixes. Can you update again? Sorry.

avatar sanderpotjer
sanderpotjer - comment - 2 Feb 2014

@Bakual PR is updated

avatar phproberto
phproberto - comment - 2 Feb 2014

Test

It took some time but I finally tested it :+1:

  • Create a new user and check article editing permissions. Tracker issues #33149 & #32956
  • backend | com_banners > banners view
  • backend | com_banners > banner edit
  • backend | com_banners > clients view
  • backend | com_banners > client edit
  • backend | com_banners > tracks view
  • backend | com_categories > categories view
  • backend | com_categories > category edit
  • backend | com_contact > contacts view
  • backend | com_contact > contact edit
  • backend | com_content > articles view
  • backend | com_content > article edit
  • backend | com_content > featured view
  • backend | com_finder > filters view
  • backend | com_finder > filter edit
  • backend | com_finder > index view
  • backend | com_finder > map view
  • backend | com_installer > default view
  • backend | com_installer > languages view
  • backend | com_installer > manage view
  • backend | com_languages > installed view
  • backend | com_languages > languages view
  • backend | com_languages > language edit
  • backend | com_languages > overrides view
  • backend | com_languages > override edit
  • backend | com_menus > items view
  • backend | com_menus > item edit
  • backend | com_menus > menus view
  • backend | com_menus > menu edit
  • backend | com_messages > messages view
  • backend | com_messages > send message
  • backend | com_modules > modules view
  • backend | com_modules > module edit
  • backend | com_newsfeeds > newsfeeds view
  • backend | com_newsfeeds > newsfeed edit
  • backend | com_redirect > links view
  • backend | com_redirect > link edit
  • backend | com_search > searches view
  • backend | com_tags > tags view
  • backend | com_tags > tag edit
  • backend | com_templates > styles view
  • backend | com_templates > style edit
  • backend | com_templates > templates view
  • backend | com_templates > template edit
  • backend | com_users > users view
  • backend | com_users > user edit
  • backend | com_users > groups view
  • backend | com_users > group edit
  • backend | com_users > levels view
  • backend | com_users > level edit
  • backend | com_users > notes view
  • backend | com_users > note edit
  • backend | com_weblinks > weblinks view
  • backend | com_weblinks > weblink edit

Test images:

Users cannot edit:
error-1-visible
Users cannot edit fixed:
error-1-fixed

avatar phproberto phproberto - reference | - 2 Feb 14
avatar phproberto phproberto - change - 2 Feb 2014
Status New Closed
Closed_Date 0000-00-00 00:00:00 2014-02-02 23:57:07
avatar phproberto phproberto - close - 2 Feb 2014
avatar phproberto phproberto - close - 2 Feb 2014
avatar sanderpotjer
sanderpotjer - comment - 3 Feb 2014

Thanks for testing & committing @phproberto!

avatar Bakual
Bakual - comment - 3 Feb 2014

Jenkins still found seven codestyle issues. That's actually not that bad for 85 changed files :smile:
Should now be fixed.

avatar sanderpotjer
sanderpotjer - comment - 3 Feb 2014

Thanks for fixing that @Bakual!

avatar Bakual Bakual - reference | f52e923 - 12 May 14
avatar sanderpotjer sanderpotjer - head_ref_deleted - 12 Jul 2014

Add a Comment

Login with GitHub to post a comment