The WebformHandlerFormBase::getUniqueMachineName method always returns an empty suggestion and the plugin label is used as machine name.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3005493-9.patch | 5.93 KB | jrockowitz |
| #8 | 3005493-7.patch | 5.07 KB | jrockowitz |
| #2 | webform-getuniquemachinename_empty_suggestion-3005493-2.patch | 667 bytes | facine |
Comments
Comment #2
facine commentedComment #3
jrockowitz commentedI am not sure what this patch is fixing. When the handler's machine name is blank the title is automatically converted to the machine name.
Can you please describe the steps required to reproduce this issue?
Comment #4
facine commentedThe name is always the same, also if the name is already taken.
Comment #5
facine commentedComment #6
facine commentedComment #7
jrockowitz commentedThe is working as intended.
A handler's 'title' defaults to the plugin's label
A handler's 'machine name' defaults to plugin's label converted to a machine name.
\Drupal\webform\Form\WebformHandlerFormBase::getUniqueMachineName is returning blank to allow the handler's title to be used to generate the machine name.
I am seeing how this approach is not working for non-English handlers.
Comment #8
jrockowitz commentedThe attached patch generates a autoincrement translated and transliterate machine name.
Honestly, I have not tested it on a multilingual site but it should work. ;)
Comment #9
jrockowitz commentedMinor improvements to the patch.
Comment #10
facine commentedOh, thank you, I test it and give you feedback!
Comment #12
jrockowitz commentedI committed the patch. Please download the latest dev release to review. Please reopen this ticket if you find any issues.