Given a BaseFieldDefinition field (entity refrerence type), set with an unlimited cardinality and with the chosen widget, chosen module then break the edit form of the entity.

The website encountered an unexpected error. Please try again later.
Error: Call to a member function getFieldStorageDefinition() on null in chosen_pre_render_select() (line 116 of modules/contrib/chosen/chosen.module).
chosen_pre_render_select(Array)
call_user_func('chosen_pre_render_select', Array) (Line: 378) 

Because the field loaded is not a FieldConfig.

$field = FieldConfig::loadByName($element['#entity_type'], $element['#bundle'], $element['#field_name'])->getFieldStorageDefinition();

and therefore the $field is null and then we've got a fatal error.

CommentFileSizeAuthor
#4 3088831-4.patch1.49 KBflocondetoile
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

flocondetoile created an issue. See original summary.

flocondetoile’s picture

Issue summary: View changes
flocondetoile’s picture

Title: Chosen break if it apply to a BaseFieldDefinition » Chosen break if applied to a BaseFieldDefinition
flocondetoile’s picture

Status: Active » Needs review
FileSize
1.49 KB
flocondetoile’s picture

nagy.balint’s picture

Status: Needs review » Fixed

Thanks!

Status: Fixed » Closed (fixed)

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