Closed (fixed)
Project:
Entity Reference Modal
Version:
1.0.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
16 Jan 2025 at 08:00 UTC
Updated:
4 Jun 2025 at 12:47 UTC
Jump to comment: Most recent
Comments
Comment #3
kaszarobertComment #5
lazzyvn commentedthis patch is not good but i still merge and fix it later. actually It needs to check method on entity label() if it exists because different entities will have different title function
Comment #7
lazzyvn commentedComment #8
sahil.shaikh commentedOn Above discussed patch can't this be applied
$data = json_encode($query + [
"entity" => $entity->$labelKey->value . " (" . $entity->id() . ")",
]);
instead of
$data = json_encode($query + [
"entity" => $entity->label() . " (" . $entity->id() . ")",
]);
where we are already checking entity type and getting its labelKey and fetching the value
Comment #9
sahil.shaikh commentedComment #10
lazzyvn commentedtry dev version it fixed
Comment #12
pearls commentedIt still doesn't work.(Dev version)
If you create a new entity, the output is still"%Auto Entity Label% (394)".
If you select from a list of existing entities, the output is "empty". The selected entity is not visible and is not loaded.
Comment #13
lazzyvn commentedI think the module can't support automatic entity label because it uses hook_inline_entity_form_table_fields_alter and hook_entity_insert / hook_entity_presave to generate the label after save, this is not the right way, it should use the event lister on the entity you can do it by your custom module.
Comment #14
pearls commentedOk. Thanks Lazzyvn.