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.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | Screen Shot 2017-11-13 at 9.19.24 AM.png | 15.52 KB | guptahemant |
| #7 | Screen Shot 2017-11-13 at 9.19.02 AM.png | 12.98 KB | guptahemant |
| #7 | Screen Shot 2017-11-13 at 9.18.45 AM.png | 53.47 KB | guptahemant |
| #5 | when_using-2922392-5.patch | 856 bytes | purushotam.rai |
| #2 | replace_token_on_auto_prefill-2922392-2.patch | 535 bytes | guptahemant |
Comments
Comment #2
guptahemant commentedHere I am attaching a patch to solve issue ,please review.
Comment #3
gg24 commentedHi @guptahemant,
I am able to reproduce this issue and gets a solution with the above patch.
Hence moving it to RTBC.
Thanks!
Comment #4
purushotam.rai commentedSorry @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
Comment #5
purushotam.rai commentedSupporting 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
Comment #6
purushotam.rai commentedCode 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.
Comment #7
guptahemant commentedhi @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.
Comment #8
purushotam.rai commentedThanks @gg24 and @guptahemant for all your inputs.