metatag_post_update_remove_robots_noydir_noodp() fails on entity types without revision support

Created on 28 May 2023, about 1 year ago
Updated 15 June 2023, about 1 year ago

Hello,

I just try to drush updb the upgrade of Metatags that just installed.

Problem/Motivation

$ drush updb
--------- ---------------- ------------- ---------------------------------
Module Update ID Type Description
--------- ---------------- ------------- ---------------------------------
metatag remove_robots_ post-update Remove 'noydir', 'noodp' ROBOTS
noydir_noodp options from meta tag entity
fields.
--------- ---------------- ------------- ---------------------------------

Do you wish to run the specified pending updates? (yes/no) [yes]:
>

> [notice] Update started: metatag_post_update_remove_robots_noydir_noodp
> [error] SQLSTATE[42S02]: Base table or view not found: 1146 Table 'patricegr_publicitempro.user_revision__field_metatag' doesn't exist: SELECT "user_revision__field_metatag"."entity_id" AS "entity_id", "user_revision__field_metatag"."revision_id" AS "revision_id", "user_revision__field_metatag"."langcode" AS "langcode", "user_revision__field_metatag"."field_metatag_value" AS "field_metatag_value"
> FROM
> "user_revision__field_metatag" "user_revision__field_metatag"
> WHERE ("bundle" = :db_condition_placeholder_0) AND (("field_metatag_value" LIKE :db_condition_placeholder_1 ESCAPE '\\') OR ("field_metatag_value" LIKE :db_condition_placeholder_2 ESCAPE '\\')); Array
> (
> [:db_condition_placeholder_0] => article
> [:db_condition_placeholder_1] => %noodp%
> [:db_condition_placeholder_2] => %noydir%
> )
>
> [error] Update failed: metatag_post_update_remove_robots_noydir_noodp
[error] Update aborted by: metatag_post_update_remove_robots_noydir_noodp
[error] Finished performing updates.

What can I do, please?

🐛 Bug report
Status

Fixed

Version

1.24

Component

Code

Created by

🇫🇷France floown

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @floown
  • 🇺🇸United States DamienMcKenna NH, USA

    Oh dear.

    The code assumes that entities with the Metatag field would have revisions, which is clearly not the case for the User entity type.

    Bumping the priority. This needs a fix.

  • 🇺🇸United States DamienMcKenna NH, USA

    I added this to the list of known issues for the 8.x-1.24 release.

  • 🇺🇸United States DamienMcKenna NH, USA
  • 🇺🇸United States DamienMcKenna NH, USA

    Will need to expand the test coverage to make sure the data is correct.

  • 🇻🇪Venezuela jvizcarrondo

    Same problem with commerce_store module
    Error: Drupal\Core\Database\DatabaseExceptionWrapper: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mydatabase.commerce_store_revision__field_meta_tags' doesn't exist: SELECT "commerce_store_revision__field_meta_tags"."entity_id" AS "entity_id", "commerce_store_revision__field_meta_tags"."revision_id" AS "revision_id", "commerce_store_revision__field_meta_tags"."langcode" AS "langcode", "commerce_store_revision__field_meta_tags"."field_meta_tags_value" AS "field_meta_tags_value" FROM "commerce_store_revision__field_meta_tags" "commerce_store_revision__field_meta_tags" WHERE ("bundle" = :db_condition_placeholder_0) AND (("field_meta_tags_value" LIKE :db_condition_placeholder_1 ESCAPE '\\') OR ("field_meta_tags_value" LIKE :db_condition_placeholder_2 ESCAPE '\\')); Array ( [:db_condition_placeholder_0] => blog [:db_condition_placeholder_1] => %noodp% [:db_condition_placeholder_2] => %noydir% )
    in metatag_post_update_remove_robots_noydir_noodp() (linea 253 de /var/xxxx/web/modules/contrib/metatag/metatag.post_update.php).

  • 🇺🇸United States DamienMcKenna NH, USA
  • Status changed to Needs review about 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    372 pass
  • 🇺🇸United States DamienMcKenna NH, USA

    Some minor changes to the update script.

  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.5 + Environment: PHP 7.3 & MySQL 5.7
    last update about 1 year ago
    372 pass
  • 🇺🇸United States DamienMcKenna NH, USA

    Just the changes to metatag_post_update_remove_robots_noydir_noodp().

  • Status changed to RTBC about 1 year ago
  • 🇮🇳India uditrawat

    Tested with metatag 8.x-1.24, it is working for me.

  • 🇫🇷France floown

    Thank you Damien.

    I have done in the metatag folder a:

    $ wget https://www.drupal.org/files/issues/2023-05-29/metatag-n3363189-9.patch
    
    $ patch -p1 < metatag-n3363189-9.patch
    patching file metatag.post_update.php
    
    $ drush updb
     --------- ---------------- ------------- ---------------------------------
      Module    Update ID        Type          Description
     --------- ---------------- ------------- ---------------------------------
      metatag   remove_robots_   post-update   Remove 'noydir', 'noodp' ROBOTS
                noydir_noodp                   options from meta tag entity
                                               fields.
     --------- ---------------- ------------- ---------------------------------
    
    
     Do you wish to run the specified pending updates? (yes/no) [yes]:
     >
    
    >  [notice] Update started: metatag_post_update_remove_robots_noydir_noodp
    >  [notice] 1 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 2 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 8 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 18 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 28 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 38 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 48 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 58 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 68 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 78 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 88 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 98 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 108 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] 115 sur 115 enregistrements Metatags suplantés traités.
    >  [notice] Update completed: metatag_post_update_remove_robots_noydir_noodp
     [success] Finished performing updates.
    
    

    It's for noobs, like me ^^

    Regards

  • 🇻🇪Venezuela jvizcarrondo

    The patch #9 works with Commerce Store
    Regards

  • 🇺🇸United States DamienMcKenna NH, USA

    Thank you all for the reviews, this change will be committed in a few days and released in 8.x-1.25.

  • Status changed to Fixed about 1 year ago
  • 🇺🇸United States DamienMcKenna NH, USA

    I'll do a separate task to add a Metatag field to the User entity type so that we can add test coverage for this scenario.

    In the meantime this is good to go, thank you for the reviews.

    This fix will be in 8.x-1.25 which I intend to release in a few days.

  • 🇮🇳India Jabastin Arul

    This is not yet resolved and I getting the issue still on my website.

  • 🇺🇸United States DamienMcKenna NH, USA

    Jabastin: Did you update to 8.x-1.25?

  • 🇮🇳India Jabastin Arul

    Yes. I have updated the 8.x-1.25. But still issue exist.

  • 🇮🇳India Jabastin Arul

    metatag remov post-update Remove 'noydir', 'noodp' ROBOTS
    e_rob options from meta tag entity fields.
    ots_n
    oydir
    _nood

    This update is getting failed again and again.

  • 🇺🇸United States DamienMcKenna NH, USA

    Jabastin: How many Metatag fields do you have on your entities? How many would you say have values set for the "robots" tag?

  • 🇮🇳India Jabastin Arul

    DamienMcKenna: I have only one Metatag fields in one content type. Where I have to see "robots" tag? Please confirm

  • 🇮🇳India Jabastin Arul

    I am getting the issue in page content type and I have enabled the default setting only.

  • 🇺🇸United States DamienMcKenna NH, USA

    @Jabastin: Please open a new issue and we can dig into this further. Thank you.

  • 🇮🇳India Jabastin Arul

    Add a new issue.

    https://www.drupal.org/project/metatag/issues/3366933 🐛 Errors in field configuration can lead metatag_post_update_remove_robots_noydir_noodp() to fail Fixed

    I need a quick fix for that. Please help me.

  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.69.0 2024