Problem/Motivation
We have a PDF that gets filled from two entities when they are both available— a household node and a program node. Both have a field_address. If the household node is available, it is listed first and its address takes precedence— all is good. If the household node is not available, the program address is placed where only the household address should be— both are accurately represented by [node:field_address:line1] etc, after all.
Steps to reproduce
Proposed resolution
This is slightly related to #3050573: Add a default_bundle field to further narrow down the default entity choice
Except it would go further and hold all fields for the default bundle (even if no instance was given), only allowing instances of secondary bundles to fill in fields not claimed by the default.
But, probably the solution here should be coming from tokens, and we introduce bundle-scoped tokens, which can be used in FillPDF or anywhere else. There does not currently seem to be such a thing, except by implementing custom tokens.
Or our site could refactor to not share field names across bundles, of course, but that does not seem ideal.
Comments