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.
I have a content entity type that uses bundle plugins (Commerce License).
I'm making a view of this entity, and I've added the bundle field, 'license type'.
The field handler works, but it outputs the machine name rather than the label of the plugin.
Comment | File | Size | Author |
---|---|---|---|
#6 | 2914092-6-views-fix-bundle-fields.patch | 3.36 KB | bojanz |
Comments
Comment #2
bojanz CreditAttribution: bojanz at Centarro commentedLet's fix this in Commerce first.
Comment #3
joachim CreditAttribution: joachim commentedThere's a core issue where I filed a patch for a similar problem, but with bundles that are defined in code with the bundle hook.
Which IIRC is what Entity API does, just that it sources the bundles from the plugins.
Might be worth a look?
Comment #4
bojanz CreditAttribution: bojanz at Centarro commentedIndeed. Can you find the core issue?
Comment #5
joachim CreditAttribution: joachim as a volunteer commentedCouldn't find it earlier, but just went and jumped through some related issues and it's this: #3056998: use the 'bundle' filter plugin for non-entity bundle fields. Though it's for the Views filter rather than field.
Comment #6
bojanz CreditAttribution: bojanz at Centarro commentedHere's a patch for the field handler. We already have a fix for the filter problem.
Also took the opportunity to remove commerce_views_data_alter(), and move its overrides to CommerceEntityViewsData.
Comment #7
bojanz CreditAttribution: bojanz at Centarro commentedCommitted.