As from the related issue ,after adding the new functionality for "Automatically prefill the label" ,the tokens are not being replaced when placed on title field or being replaced on saving, in my opinion token if available should be rendered while creating the entity.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

guptahemant created an issue. See original summary.

guptahemant’s picture

Assigned: guptahemant » Unassigned
Status: Active » Needs review
FileSize
535 bytes

Here I am attaching a patch to solve issue ,please review.

gg24’s picture

Status: Needs review » Reviewed & tested by the community

Hi @guptahemant,

I am able to reproduce this issue and gets a solution with the above patch.
Hence moving it to RTBC.

Thanks!

purushotam.rai’s picture

Status: Reviewed & tested by the community » Needs work

Sorry @guptahemant, but we still want some different approach as token nid won't be available in this case and hence this approach won't work

What are your views on this?

Thanks and Regards

purushotam.rai’s picture

Supporting NID token as of now seems not possible directly because we don't have nid in hook_pre_save and hence we need to find some way regarding this.

But, to resolve this we need not prefill it, instead, I found out the way to resolve the issue regarding why this is not working with existing pre-save auto label generation process (https://www.drupal.org/project/issues/auto_entitylabel/2922829)

Here goes my patch

purushotam.rai’s picture

Status: Needs work » Fixed

Code committed to 8.x-2.x

Thanks for all your valuable inputs and time. This means a lot. Marking this issue as fixed as of now, feel free to reopen or discuss in case the issue still persists.

guptahemant’s picture

hi @purushotam.rai ,
There is a new scenario raised because of the solution used in #5,
If I change the autoprefilled pattern before saving the node then the output is not changed as it should be ,Please check the attached screenshots ,hence changing the status to needs work.

purushotam.rai’s picture

Status: Needs work » Fixed

Thanks @gg24 and @guptahemant for all your inputs.

Status: Fixed » Closed (fixed)

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