By johnchque on
Change record status:
Published (View all published change records)
Project:
Introduced in branch:
8.x-1.x
Issue links:
Description:
The library entity form has changed the way how it defines its form ID.
The form ID is now build like:
public function getFormId() {
// If the entity is not new, add the entity id. This will allow having more
// than one form open when editing a library item within another.
// To alter this form use hook_form_BASE_FORM_ID_alter.
if ($this->entity->id()) {
return 'paragraphs_library_item_edit_form_' . $this->entity->id();
}
return 'paragraphs_library_item_edit_form';
}
After this change, altering the Library Item form will be made with the hook hook_form_BASE_FORM_ID_alter.
Before
/**
* Implements hook_form_FORM_ID_alter().
*/
function paragraphs_library_form_paragraphs_library_item_edit_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$library_item = $form_state->getFormObject()->getEntity();
// Your code here.
}
After
/**
* Implements hook_form_BASE_FORM_ID_alter().
*/
function paragraphs_library_form_paragraphs_library_item_form_alter(&$form, FormStateInterface $form_state, $form_id) {
$library_item = $form_state->getFormObject()->getEntity();
// Your code here.
}
Impacts:
Module developers
Themers
Site templates, recipes and distribution developers