User tests: Successful: Unsuccessful:
Pull Request for Issue #12785.
This PR solves the issue above, also does more performance and memory usage otimizations.
Now almost none rules check will use the old method (direct bd check).
Also added a log message and a fallback when the asset for the item is not found.
The ACL system needs to be tested as a whole.
Please test with caution. This is not a fast test.
First you need to do a code review and with that check for potential B/C issues.
Then you need to test asset inheritence: Global config -> Component [-> Categories] -> Item and also user group inheritence.
Some examples (asset inheritence: Global config -> Component [-> Categories] -> Item):
Note: In all the cases above you need to also check user group inheritence.
Finnaly, you need to do some other tests like this:
#__assets
table it should fallback to the component asset or to root asset (in case of a component).None.
Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Title |
|
||||||
Labels |
Added:
?
|
Title |
|
@andrepereiradasilva
I will try to make a through test of this tomorrow (please wait for my test too before merging this)
Title |
|
I have tested this item
Before:
53 Queries Logged 33.70 ms
After:
51 Queries Logged 30.68 ms
yes, and should work like that, but you can see by the time taken that's it's using several layers of memory caching, no db access.
Also, probably in the code you are making two ACL checks for that component, so you get two checks there.
I have tested this item
I have tested with Article, Categories, Modules, and my own component, all works as it was in 3.6
@andrepereiradasilva thanks!
I don't think this is B/C with classes extending JAccess.
@phproberto if this PR is not B/C for that motive, then i guess the other PR (#12028 - already merged for 3.7.0) would not be B/C too and, if so, needs to be reverted.
mantainers please advice
Status | Pending | ⇒ | Ready to Commit |
RTC
Labels |
Added:
?
|
Milestone |
Added: |
@brianteeman did you read @phproberto comment about potencial B/C issues?
also @ggppdk wants to test this, and i prefer this to be tested by as many people as possible.
so please remove the RTC for now
@phproberto can you give an example or is this just a "theory"
It's just a theory that says that nobody cares about B/C here.
If you cannot see that methods are returning different values, properties are removed, etc. And then we wonder why extension developers create their own framework for everything.
Keep ignoring people and merge this. You have your 2 tests and we are saving those incredible 3ms. That's more important than the CMS reputation.
I compared with J3.6.4 (do not compare with current staging)
I think you can let these the property and the method in the code,
and mark them Deprecated,
in the rare case that someone both extends the JAccess class, and also tries to use / override the removed method / property
and also you can make preloadComponents() also return $components as before ?
I have tested a little, i will test properly later today and post my test too
[EDIT]
also propected property that is removed: $assetRulesIdentities
and propected property: $assetRulesIdentities is renamed to: $assetIdByName
plus the returning value preloadPermissions() that @phproberto mentions below
Method preloadPermissions()
was returning boolean
and now returns void
:
https://github.com/joomla/joomla-cms/pull/12809/files#diff-bbdd2441fb63d5dea47802e51fc9df75L297
1 protected property removed: protected static $assetPermissionsParentIdMapping = array();
1 protected method removed: protected static function &preloadPermissionsParentIdMapping($assetType)
Method protected static function preloadComponents() used to return $components, but no longer returns anything
Which means @phproberto is right and this isn't B/C.
It is perfectly fine to extend this class, and thus anything which isn't private has to stay and behave the same.
Removing RTC label.
Status | Ready to Commit | ⇒ | Pending |
Labels |
I agree with @phproberto and @Bakual. This PR breaks B/C. You cannot merge it in 3.x. Any changes which modify public and protected members must only be included in the next major version, 4.0.
It does not matter if extending JAccess is "rare" or not. This project has committed to semantic versioning. As a result any backwards incompatible changes, no matter how "rare" their impact you think it is, cannot go in a minor version. Putting this to discussion or, worse, ignoring it when putting an RTC label reflects very badly on the trustworthiness of this project and the competence of its community. Please be careful with b/c. We don't want to go back to the Wild West of 1.5 to 3.1.
This PR breaks B/C.
yes, but all cases of B/C break can be fixed and then this can be merged (after re-testing)
Please be careful with b/c.
Totally agreed
We can only review and comment on code written. Tags apply to the code written. If the code is rewritten it will be retested.
That said, my personal take on this is that the b/c changes are the heart of this PR and were made for performance reasons. Reverting them would essentially revert the PR or, worse, end up with dead code in the class not used elsewhere. I'd like to be proven wrong. So write the code and I'll review it. Fair?
Just to say i'm not ignoring anyone. that's why i asked to check b/c.
thanks all for your time and comments. I will make a pr to revert the other PR to solve the current issue and b/c issues. will close this one and will work on a b/c alternative that includes both pr otimizations or will make it to 4.0 branch.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-11-08 08:38:30 |
Closed_By | ⇒ | andrepereiradasilva |
Thank you @andrepereiradasilva! Please tag us who commented here on your new PR so we can test it :)
sure, thanks you again
@phproberto sorry you misunderstood what I was trying to say (and its my fault I wrote too short a reply)
@sanderpotjer please also check this