Attempted to create an instance of field with name field_meta_tags on entity type node when the field storage does not exist.

Created on 9 February 2023, almost 2 years ago
Updated 21 February 2023, almost 2 years ago

Problem/Motivation

The new fields (config/optional) are introduced here:
https://www.drupal.org/project/thunder/issues/3269389
(field.field.node.page.field_meta_tags.yml and field.field.node.page.field_paragraphs.yml)

and the new update hook is also added: thunder_update_8322()
https://git.drupalcode.org/project/thunder/-/blob/6.5.x/thunder.install#...

The problem is that on existing websites (that don't have field_meta_tags and field_paragraphs) updb always fails:

```
> [notice] Update started: thunder_update_8332
> [error] Attempted to create an instance of field with name field_meta_tags on entity type node when the field storage does not exist.
> [error] Update failed: thunder_update_8332
[error] Update aborted by: thunder_update_8332
[error] Finished performing updates.
```

I don't know if this ever worked, or if something is changed in the meantime in drupal/core (field) or drupal/update_helper.

Proposed resolution

In the thunder_update_8322.yml file - field storage definitions are missing. If I add them, the update hook works, and new fields are created as basic page fields. So at least we can have upgrade hooks successfully completed.
In our use case, we don't need those fields, as we have already paragraph (named as field_p) and metatags (named as field_metatags) fields, but that's another story/issue.. In this case, we can simply delete them afterward. Maybe related: https://www.drupal.org/project/thunder/issues/3271594

🐛 Bug report
Status

Fixed

Version

6.5

Component

Code

Created by

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

Comments & Activities

Production build 0.71.5 2024