- πΊπΈUnited States trigdog
Changing status to Critical as this module seems to have an issue with it's field schema (not sure it is just related to Drupal 10 or not).
Got this error as well. Running Drupal 10.2 and the 2.0.0-beta2 of this module. Installed on new site I started today. Installed without errors. Adding a serial field to a content type produces the white screen error and the log shows the error mentioned above:
Drupal\Core\Field\FieldException: Attempted to create an instance of field with name field_client_id on entity type user when the field storage does not exist. in Drupal\field\Entity\FieldConfig->getFieldStorageDefinition() (line 316 of /opt/drupal/web/core/modules/field/src/Entity/FieldConfig.php).
You cannot access the content type anymore or uninstall the module with this broken field storage but you can remove the broken field using drush.
Steps to remove field using drush:
- Export site config: drush cem
- Find the config name for the broke field in the exported directory on the server. In my case it was: field.field.node.invoice.field_invoice_number
- run the delete config command (replace my config name with yours): drush config-delete field.field.node.invoice.field_invoice_number
- Clear cache
- π¬π§United Kingdom pivwani
I have the same issue here. I have found that if you create a content type, add the field with the same name as the problem field and choose text plain, you can then delete the problematic content type and the content type you temporarily created.
We do need a fix for this though, this only gets you out of the "This website encountered a problem" message.
- π΅π±Poland arael3
Same issue when added a new field with the serial field: "Attempted to create an instance of field with name ... on entity type node when the field storage does not exist.".
- πΊπΈUnited States duckydan
I am hitting this same issue:
Drupal\Core\Field\FieldException: Attempted to create an instance of field with name field_share_code on entity type node when the field storage does not exist. in Drupal\field\Entity\FieldConfig->getFieldStorageDefinition() (line 316 of /var/www/html/beta.weavercafe/web/core/modules/field/src/Entity/FieldConfig.php).
- πΊπΈUnited States ultimike Florida, USA
I'm having the same issue. I spent a couple of hours trying to figure out what the issue is - my main takeaway is that I do not understand why this module has its own storage interface class (src/SerialStorageInterface.php).
Anyone have the answer to this?
-mike
- Status changed to Needs review
10 months ago 9:52pm 18 February 2024 - πΊπΈUnited States ultimike Florida, USA
I think I tracked down the culprit - an unnecessary
$field->save()
in this module's implementation ofhook_ENTITY_TYPE_create()
.I've created a merge request.
I did some manual testing on my local and it seems that (at least) the core functionality of the module is working for me. I haven't pushed it very hard though...
Functional tests are also passing on my local.
-mike
- πΊπΈUnited States ultimike Florida, USA
Ah rats - I forked the wrong branch. Stand by...
-mike
- Status changed to RTBC
10 months ago 10:56am 19 February 2024 - π¬π§United Kingdom intrafusion Edinburgh, UK
Same problem and MR fixes it
- First commit to issue fork.
- Status changed to Needs review
10 months ago 9:16pm 25 February 2024 - πΊπΈUnited States benjifisher Boston area
I am updating the category: this issue is a bug report, not a support request.
I agree that the priority is Critical. Perhaps the current version will work on a site that is upgrading from an earlier version, and already has one or more serial field. But if a site adds this module and tries to create a serial field, it will not work.
I vote +1 for the fix in the MR. I am updating the MR with a test-only change, so I am setting the status back to NR.
My change is to use the admin UI instead of the API to add a field in the functional test. When I exercise the test locally, it passes. If I revert the fix, then it fails. I am a little surprised that it fails with a different error message:
Drupal\Core\Entity\EntityStorageException: 'field_config' entity with ID 'entity_test.entity_test.field_serial' already exists. in Drupal\Core\Entity\EntityStorageBase->doPreSave() (line 519 of core/lib/Drupal/Core/Entity/EntityStorageBase.php).
For reference, here are the top few lines of the stack trace:
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 257) Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object) (Line: 354) Drupal\Core\Entity\EntityBase->save() (Line: 609) Drupal\Core\Config\Entity\ConfigEntityBase->save() (Line: 42) serial_field_config_create(Object)
FWIW, it is not clear that the problem described in the issue summary is the same as the one discussed in Comment #2 and following.
- Status changed to RTBC
10 months ago 2:40pm 29 February 2024 - πΊπΈUnited States pwolanin
Gave this a quick review - seems like a fine test change to back to RTBC
-
benjifisher β
committed 320645a7 on 2.0.x authored by
ultimike β
Issue #3412857 by benjifisher, ultimike, dkyndt, pivwani, trigdog,...
-
benjifisher β
committed 320645a7 on 2.0.x authored by
ultimike β
- Status changed to Fixed
10 months ago 3:06am 1 March 2024 - πΊπΈUnited States benjifisher Boston area
Now that I have enabled GitLab CI testing for this project ( π Enable testing with GitLab CI Fixed ) the tests showed a couple of problems, so I added some small commits to fix them.
Thanks to everyone who commented on this issue. The original report, the clarification of the issue, the "works for me" comments, and of course the fix in the MR all contributed to getting this issue done.
Automatically closed - issue fixed for 2 weeks with no activity.