-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix d8 User Entity Reference fields #117
Fix d8 User Entity Reference fields #117
Conversation
https://www.drupal.org/node/2448729 is the relevant Drupal issue, which holds no help at present. Hardcoding a reference to User is horrible but easy. The only alternative I can see without rearchitecting the whole thing is to iterate over the entity base fields and choose the first one that is required but not the id or uuid key. However, that seems like not much of an improvement, so I suggest we do it your way for now. |
I don't like the solution either, but we are already doing the same thing for D7 so this will do for now :) |
Agreed it's good enough for now. I think it is something that Robust Entity handling (jhedstrom/drupalextension#337) might be able to help with. Basically if we had something like our own Behat Drupal User class (extending a Behat Drupal Entity class) that offered the properties/methods we needed. Then we could query the labelField() method of the class and get the field name we needed. |
The CS issues that cause the test fails are unrelated, and I think have been fixed since the last tests ran here. |
I just ran into this exact bug an applied the same fix - any ETA? Looking at https://www.drupal.org/node/2448729 there are several possible problem entity types - maybe need a switch statement to handle the ones in core at least? |
Oh yeah we should fix this. I wish github had some kind of way to follow or flag issues, I have no time to look at it now, and when I will have time I won't be able to find it any more :( |
As a maintainer you've got access to issue labels;
using a few like "Architecture", "Priorities" and "RTBC" might help.
You can filter issues by label.
I'd be up for helping with issue triage if you like, but alas it requires
giving me write access(though I'd very happily agree never to commit to
master or merge PR's).
Useful things I could do with that:
- label issues
- close ancient dead issues
- flag issues that need maintainer attention
- trigger travis retests
…On 10 March 2017 at 16:12, Pieter Frenssen ***@***.***> wrote:
Oh yeah we should fix this. I wish github had some kind of way to follow
or flag issues, I have no time to look at it now, and when I will have time
I won't be able to find it any more :(
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#117 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ADWYQYwJ4Vws6a37wqSwF6V3b0kNJ9Pfks5rkXaJgaJpZM4LY8a7>
.
|
The other entity types are less important than User - would be great to get this in. |
Note that this is working for me (applied as a patch in composer.json and testing a node type with a user entity reference field) |
Working for me too. |
Bump :) Wouldn't hurt to at least add a check to make sure there really is a label but agreed, user is by far the most common use case. |
I'm fine with this once #139 is resolved so we can verify tests are passing here. |
Tests are green again. I've kicked off a rebuild on travis. |
I think this needs to be rebased off of the latest |
d1e077c
to
3e8515f
Compare
done, sorry for the delay |
Thanks everybody! |
Fix d8 User Entity Reference fields Signed-off-by: Jonathan Hedstrom <[email protected]>
Creating a node with an user entity reference field value throws:
It would seem that the User entity does not define the label column, an issue that the d7 EntityReferenceHandler appears to work around:
So i have used the same approach to fix it, manually setting the label_key for user entities.