? Success
Pull Request for # 7205

User tests: Successful: Unsuccessful:

avatar joomdonation
joomdonation
21 Jun 2015

PR Summary

This PR fixes the issue reported at #7205. When you create a new article and change permission settings for that new article tab, that change is not saved. This happens because a typo in JTableContent class. Because of that typo, the permission settings of the new article which you created is always the same with the default permission settings of com_content component, not depend on the settings you set for that article.

Please note that this issue only happen when you create a new article, not when you edit an article

Testing instructions:

  • Create a new article, look at Permissions tab, try to change some permission settings. Save it. You will see that the permission settings you change is not being saved.

  • Apply this patch

  • Test again. The permission settings you set for the new article will be saved properly.

avatar joomdonation joomdonation - open - 21 Jun 2015
avatar joomdonation joomdonation - change - 21 Jun 2015
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Jun 2015
Labels Added: ?
avatar brianteeman
brianteeman - comment - 21 Jun 2015

Issue observed on creating a NEW article. PR resolves the issue - thanks


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

avatar brianteeman brianteeman - test_item - 21 Jun 2015 - Tested successfully
avatar joomdonation
joomdonation - comment - 21 Jun 2015

Thanks Brian.

avatar zero-24 zero-24 - change - 21 Jun 2015
Easy No Yes
avatar zero-24 zero-24 - change - 21 Jun 2015
Category ACL Libraries
avatar zero-24 zero-24 - change - 21 Jun 2015
Rel_Number 0 7205
Relation Type Pull Request for
avatar jwaisner
jwaisner - comment - 21 Jun 2015

@test

This PR resolves reported error.


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

avatar jwaisner jwaisner - test_item - 21 Jun 2015 - Tested successfully
avatar zero-24 zero-24 - change - 21 Jun 2015
Status Pending Ready to Commit
avatar zero-24
zero-24 - comment - 21 Jun 2015

RTC :smile: Thanks


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

avatar zero-24 zero-24 - change - 21 Jun 2015
Labels Added: ?
avatar infograf768
infograf768 - comment - 22 Jun 2015

IMHO, this should go in 3.4.2

avatar Bakual
Bakual - comment - 22 Jun 2015

Bug was introduced with #5230.
While this code works, I'm not that sure it makes much sense. $this->rules is actually always set as it is declared in JTable and thus the check will always return false.
I would suggest to use if (!$this->getRules()) instead if you want to check if there are rules specified.

As the original code was supposed to fix frontend editing where the permission tab is absent this needs to be tested on frontend editing as well.
And probably also on PostgreSQL.

Pinging @wilsonge, @alikon and @nikosdion as those were the testers on the original PR. So I suppose they can still test on PostgreSQL :smile:

I agree this would be good to have in 3.4.2 but it's Georges call.

avatar wilsonge
wilsonge - comment - 22 Jun 2015

isset returns false for a null variable (which is the case with rules) https://github.com/joomdonation/joomla-cms/blob/patch-15/libraries/joomla/table/table.php#L78 So whether you use that or just check using ! I don't really mind.

I would agree using $this->getRules() would make logical sense - rather than the class var (as it's more future proof).

avatar joomdonation
joomdonation - comment - 22 Jun 2015

Agree with Thomas and made the change. However, I think we might still have a possible issue here. I think when there is no permission set for that article (from frontend form ? haven't checked it yet), the permission settings of that article should be inherited from the category it is assigned to, not from the component settings as in the current code. Am I correct?

avatar wilsonge
wilsonge - comment - 22 Jun 2015

I don't think so. I'm pretty sure in the backend it's just using the default permissions for the article (which is the ones for com_content)

avatar Bakual
Bakual - comment - 22 Jun 2015

isset returns false for a null variable (which is the case with rules)

Ah true. Didn't remember that. I stand corrected :+1:

avatar Bakual
Bakual - comment - 22 Jun 2015

I think when there is no permission set for that article (from frontend form ? haven't checked it yet), the permission settings of that article should be inherited from the category it is assigned to, not from the component settings as in the current code. Am I correct?

George is right here. We don't need to inherit the permissions from the category. Otherwise you would have to change all article permissions if the category permissions are changed.
In fact we can just save an empty rule ({}) to use the defaults from either category or component. Our ACL will calculate that on rumtime when needed.

avatar nikosdion
nikosdion - comment - 22 Jun 2015

@Bakual I can't check with PostgreSQL any longer since the laptop I used for these tests was stolen and I didn't have the time to set it up on the new one. Sorry :(

avatar zero-24 zero-24 - change - 22 Jun 2015
Status Ready to Commit Pending
avatar zero-24
zero-24 - comment - 22 Jun 2015

Set back to Pending


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

avatar zero-24 zero-24 - alter_testresult - 22 Jun 2015 - brianteeman: Not tested
avatar zero-24 zero-24 - alter_testresult - 22 Jun 2015 - jwaisner: Not tested
avatar wilsonge wilsonge - change - 22 Jun 2015
Milestone Added:
avatar joomdonation
joomdonation - comment - 22 Jun 2015

@wilsonge I checked it again and saw that you are correct. When we create a new article from backend, the default permission settings is set from com_content permission settings, so you are correct.

@Bakual That's what I thought, set it to empty rule so that every permissions is "Inherited" and make it inherit permission from the category it was assigned to. However, as George pointed out, it is not how it works when the article is created from backend, so we will leave it as how it is.

Could @brianteeman and @jwaisner re-test it so that we can get this bug fixed in 3.4.2?

avatar Bakual
Bakual - comment - 22 Jun 2015

Tested with

  • creating an article in frontend: check gets triggered as expected, default permissions applied.
  • creating an article in backend: check fails as expected, permissions are saved as given in the form.
  • editing an article in frontend: permissions remain unchanged as expected (form doesn't have rules field)
  • editing an article in backend: permissions are saved as given in the form.

So I think this one is save for merging. Setting back to RTC.
If someone can run a test on PostgreSQL that would still be great.

avatar Bakual Bakual - test_item - 22 Jun 2015 - Tested successfully
avatar Bakual Bakual - change - 22 Jun 2015
Status Pending Ready to Commit
avatar alikon
alikon - comment - 23 Jun 2015

tested on MSSQL and Postgresql and works well

avatar wilsonge wilsonge - reference | 70acb99 - 23 Jun 15
avatar wilsonge wilsonge - merge - 23 Jun 2015
avatar wilsonge wilsonge - close - 23 Jun 2015
avatar wilsonge wilsonge - change - 23 Jun 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-06-23 23:07:27
Closed_By wilsonge
avatar wilsonge wilsonge - close - 23 Jun 2015
avatar zero-24 zero-24 - close - 23 Jun 2015
avatar wilsonge
wilsonge - comment - 23 Jun 2015

Merged - thanks guys :)

avatar joomdonation joomdonation - head_ref_deleted - 24 Jun 2015
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment