Attempted to create, modify or delete an instance of field with name field_icon on entity type node when the field storage does not exist.....

Created on 26 June 2024, 6 months ago
Updated 9 July 2024, 6 months ago

Steps to reproduce

1: Installed the module using Composer with the command: composer require 'drupal/iconify_field:^1.1'.

2: When I try to create an icon field inside the content type, it throws an error, the error mentioned below.

Drupal\Core\Field\FieldException: Attempted to create, modify or delete an instance of field with name field_icon on entity type node when the field storage does not exist. in Drupal\field\Entity\FieldConfig->getFieldStorageDefinition() (line 316 of core\modules\field\src\Entity\FieldConfig.php).

I've attached an image illustrating my actions—installing the module and searching within the extend panel.

🐛 Bug report
Status

Closed: cannot reproduce

Version

1.1

Component

Code

Created by

🇮🇳India aman_lnwebworks

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

Comments & Activities

  • Issue created by @aman_lnwebworks
  • Assigned to Dobefu
  • 🇳🇱Netherlands Dobefu

    Hi Aman,

    Thank you for reporting this issue! I will look into it.

  • 🇳🇱Netherlands Dobefu

    Hmm, I'm not getting any errors when I try to reproduce this. I've tried reinstalling on an existing site, and installing on a clean Drupal installation. I'll go through the stack trace, to see if I can find a way to reproduce this

  • 🇳🇱Netherlands Dobefu

    Alright, I've managed to force this to be reproduced. Here's what I did:

    • Install the module
    • Create an icon field
    • Export the configuration
    • Delete the file "field.storage.node.field_icon.yml"
    • Remove some logic in the config importer to ignore all import errors and do it anyways
    • Import the broken config
    • Observe the same error

    My conclusion is the following:
    For some reason, your Drupal installation failed to create the field storage after creating the field. At this point, I do not know why this is. I'm not ruling out that this module is causing the issue, but I believe it to be another factor.

    What you might want to try, is manually importing a "field.storage.node.field_icon.yml" file to see if that solves the issue. I've provided one (without a UUID, so it should be fine to import) for you to try. If this doesn't solve your error, at least it gets us a step further :).

    Note: the file has been renamed by Drupal.org, so you want to remove the underscore after "node" from the filename before importing

  • Issue was unassigned.
  • Status changed to Closed: cannot reproduce 6 months ago
  • 🇳🇱Netherlands Dobefu

    Hi Aman,

    Since I've not heard anything back, I'm going to close the issue. If my previous comment did not help you, please feel free to create a new issue.

Production build 0.71.5 2024