Skip to content
Snippets Groups Projects
Commit 4394be3b authored by Nguyen Ngoc Bao's avatar Nguyen Ngoc Bao
Browse files

Issue #3500175: Compatibility with the Automatic Entity Label module

parent 70f2e6c9
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,7 @@ function entity_reference_modal_submit(array &$form, FormStateInterface $form_st
}
$form_state->getFormObject()->submitForm($form, $form_state);
$entity = $form_state->getFormObject()->getEntity();
$label = $entity->$labelKey->value;
$label = method_exists($entity, 'label') ? $entity->label() : $entity->$labelKey->value;
// Check duplicated.
if (!empty($query['duplicate'])) {
$entity->save();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment