Generate the Media library field_widget_id as more 'unique'
1 unresolved thread
1 unresolved thread
Closes #3345064
Merge request reports
Activity
Filter activity
312 312 $field_name = $this->fieldDefinition->getName(); 313 313 $parents = $form['#parents']; 314 314 // Create an ID suffix from the parents to make sure each widget is unique. 315 $id_suffix = $parents ? '-' . implode('-', $parents) : ''; 315 $id_suffix = $parents ? '-' . implode('-', $parents) : $this->fieldDefinition->getUniqueIdentifier(); 316 316 $field_widget_id = implode(':', array_filter([$field_name, $id_suffix])); 317 317 $wrapper_id = $field_name . '-media-library-wrapper' . $id_suffix; - Comment on lines -315 to 317
The wrapper id should have a sepperator between the field name and the id_suffix.
317 $id_suffix = $parents ? '-' . implode('-', $parents) : $this->fieldDefinition->getUniqueIdentifier(); 318 $field_widget_id = implode(':', array_filter([$field_name, $id_suffix])); 319 $wrapper_id = $field_name . '-media-library-wrapper' . $id_suffix; 317 $id_suffix = $parents ? implode('-', $parents) : $this->fieldDefinition->getUniqueIdentifier(); 318 $field_widget_id = implode(':', array_filter([$field_name, $id_suffix])); 319 $wrapper_id = $field_name . '-media-library-wrapper' . '-' . $id_suffix;
Please register or sign in to reply