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.
From #1343934: Meta Tags & WYSIWYG Incompatibility? and #1003788: PostgreSQL: PDOException:Invalid text representation when attempting to load an entity with a string or non-scalar ID (see comment #67) it seems that the API requirement of entity_id to be numeric only applies to fieldables entities. So entity types that are not intended to have fields can have a non-numeric entity_id.
Metatag uses a numeric entity_id and that makes it incompatible with modules that do not use numeric ids, like WYSIWYG.
Comment | File | Size | Author |
---|---|---|---|
#11 | 1448324-metatag-entity-IDs-must-be-numeric.patch | 2.76 KB | Dave Reid |
#9 | metatag-n1448324-9.patch | 2.97 KB | DamienMcKenna |
#1 | 1448324-metatag-entity-id.patch | 1.17 KB | Pedro Lozano |
Comments
Comment #1
Pedro Lozano CreditAttribution: Pedro Lozano commentedSince it seems way more complicated to make WYSIWYG to use a numeric entity_id than change Metatags to use a string entity_id, I've made a patch myself with an update function.
Comment #2
Dave ReidNo, we cannot just make this change since it also changes the size of table indexes by changing this to from an integer to a varchar. If we must fix this in Meta tags, then I would much rather just add an exclusion for the stupid wysiwyg profile entity types in metatag_entity_load().
Comment #3
DamienMcKennaIn talking with Pedro about it on IRC I'd also recommend just doing a check to exclude all entities that have non-numeric IDs; changing to a non-numeric ID introduces complications, e.g. varchar columns in UTF-8 tables have to be small in order to be indexable.
Comment #4
kalabroThe same problem with Commerce Coupon (commerce_coupon) module.
Comment #5
DamienMcKennaThis is related to a core issue: #1332058: Need a way to distinguish "public/final" URIs for entities from admin and redirected ones
Comment #6
DamienMcKennaDrupal core, e.g. the Field module, uses an unsigned integer value for storing the entity_id, so Metatags needs to do the same and ignore other data.
Comment #7
DamienMcKennaTagging.
Comment #8
DamienMcKennaComment #9
DamienMcKennaAn initial pass that needs some testing. Could someone let me know of any existing contrib modules that use string entity IDs so I can test it further? Thanks.
Comment #10
Dave ReidThese changes should be unnecessary because if an entity is fieldable it has to be using numeric IDs.
Comment #11
Dave ReidRevised patch.
Comment #12
Dave ReidCommitted #11 with http://drupalcode.org/project/metatag.git/commit/a83b0c8