We explicitly ignore "commerce_line_item" and "commerce_product" as targets for field injection (inside hook_field_extra_fields()).
This makes the fields unavailable in the target entity type "Manage display" screens.
However, the hook_entity_view implementation doesn't check the entity type, meaning that the field injection still happens.
So if I render a line item, I get product fields injected that I can't disable because they are not present in "Manage display".
Ryan said on IRC that we should just modify commerce_product_reference_entity_view() and add the entity type check there.
Comments
Comment #1
bojanz commentedHere we go.
Comment #2
rszrama commentedCommitted this. I'm still uncertain what the ideal behavior is here, but this is such an edge case feature that it's best to at least consistently disable it. How much you wanna bet someone comes in with a bug report about this after the next point release? ; )
fwiw, I realized you could still disable product fields by using the view mode settings on the product type itself, but you still wouldn't be able to position them relative to the other fields / extra fields on the referencing entity b/c of the lack of extra fields.