Use 'Acl.' as plugin prefix and pluralized class name in ACL behavior#172
Use 'Acl.' as plugin prefix and pluralized class name in ACL behavior#172nook24 wants to merge 9 commits into
Conversation
hasMany associations should always use the pluralized association name: https://book.cakephp.org/4/en/orm/associations.html#hasmany-associations
This resolves an issue where the Acl Plugin itself used autogenerated Cake\ORM\Table instead of Acl\Model\Table\
markstory
left a comment
There was a problem hiding this comment.
Sorry for the delay in getting back to you, I had the notifications for this repository turned off for some reason.
| @@ -1,5 +1,5 @@ | |||
| { | |||
| "name": "cakephp/acl", | |||
| "name": "itnovum/acl", | |||
There was a problem hiding this comment.
This will need to be reverted in order to be merged.
| } | ||
|
|
||
| return $this->_table->{$type}->node($ref); | ||
| if(property_exists($this->_table, $type)){ |
There was a problem hiding this comment.
| if(property_exists($this->_table, $type)){ | |
| if (property_exists($this->_table, $type)){ |
You'll need to apply the code formatting standards. You can do that with vendor/phpcbf src tests
There was a problem hiding this comment.
Hi @markstory sorry for my late response to this.
I have created a new branch to merge the upstream changes. I also executed phpcbf but this had made so many code changes, that I would recommend to do this in a second step.
A TOTAL OF 526 ERRORS WERE FIXED IN 53 FILES
I guess otherwise the diff is getting to large. What do you think?
There was a problem hiding this comment.
Sure, we can update phpcs separately.
|
Closing as #180 was merged. |
The AclBehavior used the singular table name to add the
hasManyassociation which leats to usage of the wrong table.I also replaced
App::className()withAcl.because the Acl Plugin was using generic auto generatedCake\ORM\Tableinstead ofAcl\Model\Table\I checked some other CakePHP plugins and none of it was using
App::className()