Closed (fixed)
Project:
Drupal core
Version:
8.2.x-dev
Component:
node system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
20 Jun 2016 at 15:06 UTC
Updated:
11 Jul 2016 at 08:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
sagar ramgade commentedYes it has the duplicate code of parent's class method, patch attached removes it.
Comment #4
tstoecklerAhh so
Node::access()provides a default value butAccessibleInterface::access()does not. So we still have to leave the function around as it is, but the function body can just bereturn parent::access(...);.I guess we should also deprecate the method then so we can remove it D9. Not sure whether we should do that in this issue.
Comment #5
tstoecklerComment #6
anicky commentedComment #7
anicky commentedAs @tstoeckler said, I replaced the method with
return parent:access(...), because of the default value.Comment #8
anicky commentedIt would also may be possible to remove Node:access() if the default value is added in the parent class.
Comment #9
tstoeckler@Anicky: I think #8 would be a larger change. I think for Drupal 9 we should rather always call the operation explicitly, and not rely on a default value. That's why I think #7 is preferable. But we should to change the indentation of the
parent::...call to be inline with the coding standards. Thus, marking "needs work".Comment #10
anicky commented@tstoeckler : Indentation fixed, sorry for that.
Comment #11
tstoecklerNo need to apologize ;-), looks perfect now. Thanks a lot!
Comment #12
anicky commentedComment #13
anicky commentedComment #14
alexpottThe patch looks good but I think we should have comment saying that the override exists to set the default value on $operation otherwise it looks like #8 is the way to go. I think we should also file a 9.x issue to remove the override.
Comment #15
handrus commentedJust added the comment as per #14 suggestion
Comment #16
handrus commentedComment #17
Rafael Natal commentedJust reviewed, its just a comment. This was a effort made during drupalcamp Campinas code sprint.
Comment #18
tstoecklerUnfortunately the latest patch is not quite correct.
A) It does not include the previous patch from #10.
B) The code comment does not comply with the Drupal coding standards. It should be formatted like
C) This is super minor, but I think it would be helpful to put the word 'view' in quote in the comment. That makes the sentence clearer to read, in my opinion.
Thanks!
Comment #19
davic commentedThis patch contains the combination of #10 and #15, together with the changes needed for the code to comply with Drupal coding standards.
Comment #20
davic commentedComment #21
tstoecklerYay, thanks a lot. Looks great!
Comment #22
alexpottCommitted 241a653 and pushed to 8.2.x. Thanks!
Unfortunately adding additional information to an @inheritdoc is not permitted so I just moved the comment.