Problem/Motivation

Right now if I create a node with a modal successfully and the node title is filled automatically by the https://www.drupal.org/project/auto_entitylabel, then the input field gets this value:

"%AutoEntityLabel% (394)"

This means the title is generated after the node was saved, we need to read that from the entity instead.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

kaszarobert created an issue. See original summary.

kaszarobert’s picture

Status: Active » Needs review

lazzyvn’s picture

this 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

  • 4394be3b committed on 1.x
    Issue #3500175: Compatibility with the Automatic Entity Label module
    
lazzyvn’s picture

Status: Needs review » Closed (won't fix)
sahil.shaikh’s picture

On 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

sahil.shaikh’s picture

Status: Closed (won't fix) » Needs review
lazzyvn’s picture

Status: Needs review » Fixed

try dev version it fixed

Status: Fixed » Closed (fixed)

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

pearls’s picture

It 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.

lazzyvn’s picture

I 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.

pearls’s picture

Ok. Thanks Lazzyvn.