init batch : field_storage_values misses type

Created on 23 September 2022, over 2 years ago
Updated 19 May 2023, over 1 year ago

I got this error on initialization

NOTICE: PHP message: [error] [php] [172.22.0.1] [uid:1] [http://dev.materio.com/en/batch?_format=json&id=1298317&op=do] [https://dev.materio.com/en/batch?id=1298317&op=start] Drupal\Core\Field\FieldException: Attempt to create a field storage changed with no type. in Drupal\field\Entity\FieldStorageConfig->__construct() (line 261 of /var/www/html/d8.materio.com/public_html/web/core/modules/field/src/Entity/FieldStorageConfig.php).

$field_storage_definition->toArray(); does not provide the type value, and FieldStorageConfig needs it

here is a patch

🐛 Bug report
Status

Postponed: needs info

Version

1.0

Component

Code

Created by

🇫🇷France bachbach Le Havre

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand jlscott

    @bachbach: I am unable to replicate the error you report. Can you please advise what version of Drupal, PHP, etc you are using?

  • 🇧🇪Belgium davidiio

    Hello,

    We had the same probleme here on drupal 10.3.6, user_history 1.1.0
    When clicking "initialize" batch process won't start because a type is missing somewhere on field storage config creation.
    Applying patch from first post does make it work.

    Error:

    Drupal\Core\Field\FieldException : Attempt to create a field storage changed with no type. dans Drupal\field\Entity\FieldStorageConfig->__construct() (ligne 271 de /web/core/modules/field/src/Entity/FieldStorageConfig.php).
    

    Trace:

    #0 /web/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(222): Drupal\field\Entity\FieldStorageConfig->__construct()
    #1 /web/core/lib/Drupal/Core/Entity/EntityStorageBase.php(232): Drupal\Core\Config\Entity\ConfigEntityStorage->doCreate()
    #2 /web/core/lib/Drupal/Core/Entity/EntityBase.php(523): Drupal\Core\Entity\EntityStorageBase->create()
    #3 /web/modules/contrib/user_history/user_history.batch.inc(54): Drupal\Core\Entity\EntityBase::create()
    #4 /web/core/includes/batch.inc(296): user_history_add_tracked_fields()
    
Production build 0.71.5 2024