Closed (fixed)
Project:
Examples for Developers
Version:
8.x-1.x-dev
Component:
Content Entity Example
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jun 2015 at 17:54 UTC
Updated:
19 Sep 2015 at 11:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mile23Sounds like a good example of best practices.
Do you have a patch?
Comment #2
feyisayo commentedA patch. Of course. Sorry I didn't add this at the beginning. Here it is.
Comment #4
feyisayo commentedThis test failure appears to be an issue with the test code itself.
Comment #5
mile23Well the branch is green: https://qa.drupal.org/pifr/test/283843
If you click on the [view] link, you'll see that the test failed in the module that you changed. It's also a fatal error, and since we only changed the interface declaration here, it means there's a problem with that.
And the problem, it turns out, is that we're not declaring a method that's present in
EntityChangedInterface: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Entity%21...That method is
EntityChangedInterface::getChangedTimeAcrossTranslations(), and can be implemented by using a trait that's neatly packaged inside D8:EntityChangedTrait.So:
getCreatedTime()fromContactInterface, becauseEntityChangedInterfacealready promises it.ContactInterfaceextendsEntityChangedInterface.ContactusesEntityChangedTrait.Yay snap-together! :-)
And then add this information to the prose documentation part of
Contact, in the class docblock. Explain that we're implementingEntityChangedTraitso that we can have timestamps.And then run the tests locally to see what happens. :-)
Comment #6
feyisayo commentedAh. I see. I have been working on the Beta 10 release of Drupal in which
EntityChangedInterfaceonly had thegetChangedTime()method.I should have updated to the latest version.
Comment #7
mile23Yes, we're tracking the 8.0.x branch. So do that
git pull origin 8.0.xand you're set.Comment #8
feyisayo commentedSorry, I have been away at an event. I'll redo the changes using your outline and resubmit the patch
Comment #9
feyisayo commentedPlease disregard that comment. I didn't check the latest code before sending it.
Comment #10
feyisayo commentedHello Mile23,
Oh boy. I got this quite muddled up. I realised that sending the patch is still in order. I am sorry about the mix up.
Thanks for the clear instructions. You practically wrote the patch with words.
I have made the changes and run the tests locally. All tests passed.
Here it is
Comment #11
feyisayo commentedComment #12
pp commentedI reviewed the patch, it is looking good, but documentation is missing:
Comment #13
feyisayo commentedHello pp. Thanks for the review and I'm sorry for the delayed response.
Oh boy. How do I ask this? Documenting a patch.........could you point me to a link on how to do this?
Comment #14
pp commentedHi @feyisayo,
Your patch contains code. Documenting the code.
Please read end of the comment of @Mile23 #2504007-5: ContactInterface should provide getCreatedTime() (this is what I quoted)
Comment #15
feyisayo commentedThanks pp,
I have "duh" written on my face right now :)
I'll do that
Comment #16
feyisayo commentedSorry this is coming quite late. I have been tied up with a number of things down here.
Comment #17
feyisayo commentedComment #19
mile23Thanks, @feyisayo and @pp!
Committed with minor coding standards changes.
Comment #20
feyisayo commentedThanks for the direction @mile23 and for your help too @pp