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?

Comments

floown created an issue. See original summary.

damienmckenna’s picture

Priority: Normal » Major

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.

damienmckenna’s picture

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

damienmckenna’s picture

damienmckenna’s picture

Issue tags: +Needs tests

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

jvizcarrondo’s picture

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).

damienmckenna’s picture

Title: metatag remove_robots_ post-update Remove 'noydir', 'noodp' ROBOTS noydir_noodp » metatag_post_update_remove_robots_noydir_noodp() fails on entity types without revision support
damienmckenna’s picture

Status: Active » Needs review
StatusFileSize
new8.96 KB

Some minor changes to the update script.

damienmckenna’s picture

StatusFileSize
new3.39 KB

Just the changes to metatag_post_update_remove_robots_noydir_noodp().

uditrawat’s picture

Status: Needs review » Reviewed & tested by the community

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

floown’s picture

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

jvizcarrondo’s picture

The patch #9 works with Commerce Store
Regards

damienmckenna’s picture

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

  • DamienMcKenna committed 02f96a47 on 8.x-1.x
    Issue #3363189 by DamienMcKenna, floown, jvizcarrondo, uditrawat:...

  • DamienMcKenna committed 0cf7e86e on 2.0.x
    Issue #3363189 by DamienMcKenna, floown, jvizcarrondo, uditrawat:...
damienmckenna’s picture

Status: Reviewed & tested by the community » Fixed
Issue tags: -Needs tests

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.

jabastin arul’s picture

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

damienmckenna’s picture

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

jabastin arul’s picture

Yes. I have updated the 8.x-1.25. But still issue exist. I need quick help for fix this issue.

jabastin arul’s picture

StatusFileSize
new30.75 KB

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.

damienmckenna’s picture

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

jabastin arul’s picture

DamienMcKenna: I have only one Metatag fields in one content type. I am not tagging the " "robots" in any where

jabastin arul’s picture

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

damienmckenna’s picture

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

jabastin arul’s picture

Add a new issue.

https://www.drupal.org/project/metatag/issues/3366933

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

Status: Fixed » Closed (fixed)

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