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.
We have a number of custom entities on our site, and we had working support for metatags prior to the 7036 update.
Our entity has only one bundle (and we had no metatag key on the bundle in our entity info), so metatag_update_7036 set the variable:
metatag_enable_[custom_entity]
to FALSE, based on logic in metatag_update_7036.
The User Interface does not allow us to unset this option (since the user interface only shows a checkbox for the entity, if only one bundle exists).
Comment | File | Size | Author |
---|---|---|---|
#6 | metatag-fix_single_bundles_entities-2622662-6.patch | 891 bytes | daniel.rolls@flightcentre.com.au |
Comments
Comment #2
daniel.rolls@flightcentre.com.au CreditAttribution: daniel.rolls@flightcentre.com.au at Flight Centre Travel Group commentedI propose we change the way metatag_entity_supports_metatags handles entities with only one bundle to match the behavior in the UI.
IN metatag_entity_supports_metatags before we check the option for each bundle:
See attached patch.
Comment #3
daniel.rolls@flightcentre.com.au CreditAttribution: daniel.rolls@flightcentre.com.au at Flight Centre Travel Group commentedNote this fix works for our custom entities, and even though the configuration variable relating to its bundle:
metatag_enable_{$entity_name}_{$entity_name}
remains set to FALSE, this doesn't present a problem because if we add another bundle later on, the option to unset this will be available through the user interface.
Comment #4
DamienMcKennaComment #6
daniel.rolls@flightcentre.com.au CreditAttribution: daniel.rolls@flightcentre.com.au at Flight Centre Travel Group commentedHave fixed up the patch to remove the return value passed through as arg. Also removed accidental file mode change.
Comment #7
daniel.rolls@flightcentre.com.au CreditAttribution: daniel.rolls@flightcentre.com.au at Flight Centre Travel Group commentedComment #8
DamienMcKennaThanks for fixing the patch, @rollsd. I'll try to include it in the next release.
Comment #9
DamienMcKennaComment #10
DamienMcKennaThe tests still run.
Comment #11
DamienMcKennaComment #12
DamienMcKennaCommitted. Thanks!