The IDs of referenced images cannot be exported. The only option ist adding the "alt" field. Please add support for the image id (as it is working with taxonomy terms). Thanks in advance.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | rest_views-3011485-4-interdiff.txt | 2.47 KB | cburschka |
| #4 | rest_views-3011485-4.patch | 1.88 KB | cburschka |
| #2 | rest_views-3011485-2.patch | 1.49 KB | jayelless |
Comments
Comment #2
jayelless commentedHere is a patch that provides an export of a target_id value from an entity reference field as a numeric value. It should work with file ids as well as any other entity ids.
Comment #3
cburschkaI'm really surprised this is needed, since Image fields are a subclass of File fields, which are a subclass of Entity Reference fields. There's a field formatter for displaying the ID of an Entity Reference field in core.
Unfortunately, the plugin system doesn't know inheritance - the field formatter is annotated as being for entity_reference fields only, not for fields with a type that is a subclass of the entity_reference type.
I think I'll file a core issue for extending that annotation a bit.
In the meantime, we can add this class.
Comment #4
cburschkaMaking the integer-casting conditional on the ID actually being an integer string, which should be the case for most entity reference fields, but not all. I'm not happy with making it value-dependent like this, but there is no clean way to ask an entity if its type uses integer IDs - and content entities always return their IDs as strings even when they are stored as integers.
Comment #5
cburschka