The WebformHandlerFormBase::getUniqueMachineName method always returns an empty suggestion and the plugin label is used as machine name.

Comments

facine created an issue. See original summary.

facine’s picture

Status: Active » Needs review
StatusFileSize
new667 bytes
jrockowitz’s picture

Status: Needs review » Postponed (maintainer needs more info)

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

facine’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new133.88 KB
new108.85 KB

The name is always the same, also if the name is already taken.

facine’s picture

facine’s picture

Issue summary: View changes
jrockowitz’s picture

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

jrockowitz’s picture

StatusFileSize
new5.07 KB

The attached patch generates a autoincrement translated and transliterate machine name.

Honestly, I have not tested it on a multilingual site but it should work. ;)

jrockowitz’s picture

StatusFileSize
new5.93 KB

Minor improvements to the patch.

facine’s picture

Oh, thank you, I test it and give you feedback!

  • jrockowitz committed 64759e4 on 8.x-5.x
    Issue #3005493 by jrockowitz, facine: WebformHandlerFormBase::...
jrockowitz’s picture

Status: Needs review » Fixed

I committed the patch. Please download the latest dev release to review. Please reopen this ticket if you find any issues.

Status: Fixed » Closed (fixed)

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