We recently updated the Metatag module from ver 8.x-1.6 to 8.x-1.22. Ran updatedb which displayed 4 items to update (see below). Upon running, process errored out updating 8109 on account of an unknown column. The column references a field using the metatag structure which is called tag (field_tag). Unfortunately this was created before my time as I would have avoided a generic field name. This issue is similar to one reported in February, 2022 (https://www.drupal.org/project/metatag/issues/3262308) in which a field titled field_meta_tag had been created prior.
Another note/possible clue. When I attempt to remove the field from the content type, I receive an error message indicating 'column not found' which references my field_tag field. This occurs in two different sites using Metatags 8.x-1.6 and 8.x-1.22.
Any recommendations to resolve this would be most appreciated!
$ drush updatedb
--------- ----------------------------------- --------------- ------------------------------------------------------
Module Update ID Type Description
--------- ----------------------------------- --------------- ------------------------------------------------------
metatag 8109 hook_update_n 8109 - Update mask_icon values to the new structure.
metatag convert_author_config post-update The author meta tag was moved into the main module:
configuration.
metatag convert_author_data post-update The author meta tag was moved into the main module:
entity data.
metatag convert_mask_icon_to_array_values post-update Convert mask-icon to array values.
--------- ----------------------------------- --------------- ------------------------------------------------------
[notice] Update started: metatag_update_8109
> [error] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node__field_tags.field_tags_value' in 'field list': SELECT "node__field_tags"."entity_id" AS "entity_id", "node__field_tags"."revision_id" AS "revision_id", "node__field_tags"."langcode" AS "langcode", "node__field_tags"."field_tags_value" AS "field_tags_value"
> FROM
> "node__field_tags" "node__field_tags"
> WHERE "bundle" = :db_condition_placeholder_0; Array
> (
> [:db_condition_placeholder_0] => article
> )
>
> [error] Update failed: metatag_update_8109
In ProcessBase.php line 171:
Unable to decode output into JSON: Syntax error
{
"0": {
"metatag": {
"8109": {
"#abort": {
"success": false,
"query": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'node__field_tags.field_tags_v
alue' in 'field list': SELECT "node__field_tags"."entity_id" AS "entity_id", "node__field_tags"."revision_id" AS "r
evision_id", "node__field_tags"."langcode" AS "langcode", "node__field_tags"."field_tags_value" AS "field_tags_valu
e"\nFROM\n"node__field_tags" "node__field_tags"\nWHERE "bundle" = :db_condition_placeholder_0; Array\n(\n [:db_c
ondition_placeholder_0] => article\n)\n"
}
}
},
"#abort": [
"metatag_update_8109"
]
},
"drush_batch_process_finished": true
}
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | metatag-n3322297-9.patch | 3.69 KB | damienmckenna |
| #9 | metatag-n3322297-9.interdiff.txt | 890 bytes | damienmckenna |
| #7 | metatag-n3322297-7.patch | 3.45 KB | damienmckenna |
| #3 | metatag-post-update-issue-3322297-2.patch | 1.99 KB | Rijas Madurakuzhi |
Comments
Comment #2
avpadernoComment #3
Rijas Madurakuzhi commentedA field configuration is specific for one bundle and 'glues' the field storage information and the entity bundle together. In this update hook and postupdate function, it tries to load the fields into an array without specifying the bundles.
The attached patch worked for me in this case.
Comment #4
damienmckennaThanks for putting that patch together.
Comment #5
damienmckennaThe test failure has nothing to do with the patch, it's an unrelated bug that I'll fix separately.
Comment #6
damienmckennaOut of interest, did this happen on your site because you had different Metatag fields on your entity bundles (content types, vocabularies, etc)?
Comment #7
damienmckennaFor 2.0.x.
Comment #9
damienmckennaThis should fix the last test error.