14

I got this error while updating from Drupal 8.3.7 to Drupal 8.4.0.

RuntimeException: Unable to determine class for field type 'webform' found in the 'field.storage.node.webform' configuration in Drupal\field\FieldStorageConfigStorage->mapFromStorageRecords() (line 157 of core/modules/field/src/FieldStorageConfigStorage.php).

How can I fix this error?

2
  • 1
    I think this is not connected to the D8 version. Probably all versions will report the same error when you have a field configured in a content type where the code for the field type can't be found.
    – 4uk4
    Sep 18, 2017 at 6:58
  • Yes it's working fine. when i run the command composer require drupal/simplenews and drush cr May 24, 2021 at 8:26

3 Answers 3

52

One possible way is that your module is missing from the codebase or has been improperly uninstalled and you've still a field which is using that missing module.

Try the following drush/SQL commands to remove the broken field:

drush sqlq "DELETE FROM cache_config"
drush sqlq "DELETE FROM config WHERE name = 'field.storage.xxx.xxx' OR data LIKE '%field.storage.xxx.xxx%'"
drush sqlq "DELETE FROM config_snapshot  WHERE name = 'field.storage.xxx.xxx' OR data LIKE '%field.storage.xxx.xxx%'"

Warning: Don't execute above commands on master/live database. Make a backup before doing any database changes.

Where field.storage.xxx.xxx is your reported field storage type (e.g. field.storage.node.webform).

If above won't help, check for any other references by:

drush sql-dump --ordered-dump | grep field.storage.xxx.xxx

At the end you need to rebuild your caches:

drush cr
2
  • Thanks @kenorb for this great answer. +1 Sep 12, 2019 at 20:57
  • 1
    Thanks for this: I spent almost the whole day attempting to find a solution to this issue. Jun 6, 2022 at 19:11
3

I had a similar error with another module (address in my case). I could fix it by simply re-install the concerned module with drupal console by the following command:

drupal module:install address

And back to business :)

2
2

When I see that error my trick is to try enabling the offending module again from the command line and then clearing cache. For example:

lando drush cr                                                                                                                                                                             

In FieldStorageConfigStorage.php line 174:

  Unable to determine class for field type 'simplenews_issue' found in the 'field.storage.node.simplenews_issue' configuration  


In DiscoveryTrait.php line 53:

  The "simplenews_issue" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FieldTypePluginManager are: address, address_zone, address_country, comment, datetime, file_uri, file, image, link, list_float, list_string, list_integer, path, text_  
  with_summary, text, text_long, integer, uri, entity_reference, uuid, float, email, timestamp, string, language, created, changed, map, string_long, password, decimal, boolean                                                                               

lando drush en simplenews                                                                                                                                                                 
 [notice] Already enabled: simplenews
lando drush cr                                                                                                                                                                             
 [success] Cache rebuild complete. 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.