When saving the settings of an image field using the field_ui module I'm getting the following error:
Error: Call to a member function uuid() on null in Drupal\Core\Field\EntityReferenceFieldItemList->defaultValuesFormSubmit() (line 126 of core/lib/Drupal/Core/Field/EntityReferenceFieldItemList.php).

See https://www.drupal.org/project/drupal/issues/2833650 and https://www.drupal.org/project/mailchimp/issues/2949234

Currently some items for the default value get altered in a way that breaks the form.

Attached is a patch that checks if the items exist before altering them.
It would be good if someone who knows why the default_value gets altered checks that code block.

CommentFileSizeAuthor
required_api-broken_image_fields.patch802 bytesalduya

Comments

alduya created an issue. See original summary.

interdruper’s picture

Status: Needs review » Reviewed & tested by the community
Related issues: +#2833650: Error when saving settings of an entity reference field, +#2949234: WSOD when editing image field settings

Yep, the patch fixes the problem. Thanks.

  • 14ab216 committed on 8.x-1.x
    #2951143 Error when editing image field settings
    
lord_of_freaks’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.