... because it's the nice thing to do.

Files: 
CommentFileSizeAuthor
#1 most_boring_patch_ever.patch28.2 KBamateescu
PASSED: [[SimpleTest]]: [MySQL] 59,412 pass(es).
[ View ]

Comments

amateescu’s picture

Status:Active» Needs review
StatusFileSize
new28.2 KB
PASSED: [[SimpleTest]]: [MySQL] 59,412 pass(es).
[ View ]

Here we go.

andypost’s picture

Status:Needs review» Reviewed & tested by the community

Manually checked all classes inherited from Entity - all complete!

webchick’s picture

Yep, makes sense.

Curious if NOT doing this causes any kind of issues that we could potentially test for? Anyone who's ported their entity-related module to D8 at this point probably has missed doing this in their own methods.

amateescu’s picture

We don't have anything to test right now because all the parent methods are empty. #1605290: Enable entity render caching with cache tag support is the issue where we put some logic in two of those empty methods.

webchick’s picture

Title:All entity post*() and pre*() methods should call their parent implementation» Change notice: All entity post*() and pre*() methods should call their parent implementation
Priority:Normal» Major
Status:Reviewed & tested by the community» Active
Issue tags:+Needs change record

Cool, works for me.

Committed and pushed to 8.x. Thanks!

Needs a quick change notice.

Berdir’s picture

Title:Change notice: All entity post*() and pre*() methods should call their parent implementation» All entity post*() and pre*() methods should call their parent implementation
Priority:Major» Normal
Status:Active» Fixed
Issue tags:-Needs change record

Updated the code example in https://drupal.org/node/1400186 and added a sentence to the one that explains those methods.

I don't think this needs a separate change notice, we didn't even add a new one when we moved those methods to the Entity classes. This just applies a common OO pattern.

webchick’s picture

Makes sense. Thanks, Berdir!

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.