When you reuse a field on 2 entity types (e.g. content, user) the label shifts from "Content:" to "Field:". While this alone is mildly confusing to users coming into look for their "Content: Image" it also presents another issue of making them believe that they can use it to get their "User: Image" when in fact is not possible.
While i understand to create a user relationship, and delegate that relationship to the field i don't know how many people know or care to figure that out.
I think we could simple solve this problem by listing each field with the contexts that have been applied to it.
If a field has been attached to the "user entity" and the "content entity" it should appear twice in the "Field Selector". One for each (e.g. Content: Image, User: Image). This is true of course if and only if the relationship exists to display that field.
I feel this will make the interface more predictable with minimal adverse impact on usability/clutter. To be clear i am not suggesting listing it for each content type but just the entity type.
Comment | File | Size | Author |
---|---|---|---|
#8 | 1135918-field-api-labelling-aliases.patch | 9.66 KB | merlinofchaos |
Comments
Comment #1
michaelfavia CreditAttribution: michaelfavia commentedComment #2
dawehnerIt would be possible to add each field to each entity type it's attached to, but this might cause to blow up the views_data a bit.
Comment #3
stevectorI agree with michaelfavia that this would be helpful. I have a simple View with three fields and no relationships. One of those fields is assigned to both node and user entities.
The two fields only on the node entity query and render their node values.
The one field on both node and user entities queries and renders the user value.
It seems I can force the field to use the node value by making a relationship to the node revision. However this took me a awhile to figure out and seems like overkill.
Comment #4
dawehnerSet as task.
Comment #5
dawehnerJust some questions
Comment #6
dawehnerThe chat
Comment #7
chriscohen CreditAttribution: chriscohen commentedSubscribing.
Comment #8
merlinofchaos CreditAttribution: merlinofchaos commentedOk, so it turns out that the fields are actually working. Implicit relationships might be the cause of them not working, but I can't reproduce it.
However, labelling still sucks. This patch fixes the labelling issue. Thoughts?
Comment #9
merlinofchaos CreditAttribution: merlinofchaos commentedI committed a version of this patch that includes base table filtering so that aliases won't appear for irrelevant base tables. There's still some duplication but that should be generally acceptable.