Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up from #2010930: [META] Apply formatters and widgets to rendered entity base fields (all besides node.title).
See the other issues from the parent for instructions.
Start with just the name and then fix the test failures, the user_id reference will be a bit more complicated and require a dependency on entity_reference.module.
Comment | File | Size | Author |
---|---|---|---|
#22 | interdiff.txt | 718 bytes | swentel |
#22 | entity-test-form-2238149-22.patch | 29.57 KB | swentel |
#16 | entity-test-form-2238149-16-interdiff.txt | 1.49 KB | Berdir |
#16 | entity-test-form-2238149-16.patch | 28.87 KB | Berdir |
#10 | entity-test-form-2238149-10.patch | 30.35 KB | Berdir |
Comments
Comment #1
BerdirAdded widgets for user_id and name. Made sure that they have default values, removing the values from the test forms which are all just using it to test specific field widgets, so we have enough coverage of those. Would be annoying to update them all, especially the user_id autocomplete widget.
Comment #3
BerdirFixing those tests. The missing user table fails are because of the default value for the user_id field in entity_test. I think that's a small price to pay for all the user_id's in the forms that we can just remove instead of having to build a valid "username (id)" string for an entity reference widget.
Comment #6
Wim LeersLooking good :)
This should be removed.
2 newlines instead of 1.
Why
array(0 => 1)
and not justarray(1)
?Because you want to stress that it's a single-valued field?
Also, I think this could benefit from a comment along the lines of "Default EntityTest entities to have the root user as the owner" — that then clearly explains why you are able to remove all those
'user_id' => 1,
lines in so many tests.Add a comment like "Assign a random name to new EntityTest entities, to avoid repetition in tests."?
Comment #7
BerdirFixed KeyValueContentEntityStorageTest.
The default value needs to be like that to comply with the config schema if I remember correctly.
Comment #10
BerdirFixed merge conflict in EntityReferenceIntegrationTest. There were also som left-overs from the node formatters/widget patch that are no longe required, so cleaned that up. Most of the difference there is now reverting changes from that issue, almost back to how it was before.
Comment #11
Wim LeersComment #12
catchCommitted/pushed to 8.0.x, thanks!
Comment #15
catchNot quite.
Comment #16
BerdirYeah, sorry, I have no idea where those FormCacheTest changes are coming from.
Comment #17
Wim LeersAnd again.
Comment #18
Wim LeersIDK why this was assigned to me.
Comment #20
Wim LeersLooks like HEAD has changed again, causing this patch to fail now (it was green when I RTBC'd it).
Comment #21
BerdirYeah, entityValidateAndSave() is new, from the generate field values issue.
Comment #22
swentel CreditAttribution: swentel commentedComment #24
Wim LeersComment #25
alexpottCommitted 22d79dc and pushed to 8.0.x. Thanks!
Comment #27
Wim Leers