machine name don't have any option to allow dot "." symbol, which causing something issue since we need dot symbol inside machine name.

Comments

Cecilina created an issue. See original summary.

jrockowitz’s picture

Status: Active » Postponed (maintainer needs more info)

Nowhere is Drupal are periods allowed in machine names.

For elements, we could add support for custom machine name patterns (/admin/structure/webform/config/elements), but I must emphasize you would be on your own if you run into unexpected issues.

@see https://www.drupal.org/node/2297311

Cecilina’s picture

Yes. Understand but one of microservice need that supported format.
Here is the patch.

jrockowitz’s picture

I am okay with adding this feature but we need to support "Lowercase letters" too.

Please don't change !$this->webform->hasVariants() to !$this->webform->hasVariant()

jrockowitz’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)
StatusFileSize
new203.93 KB
new4.65 KB

Element machine names with periods don't work as expected and the inputed data is not posted back to the server.

Below is an example element for the attached example webform.

textfield.with.periods:
  '#type': textfield
  '#title': textfield.with.periods

Here is a screencast showing the data loss.

HTML does allow periods in input names.
@see https://stackoverflow.com/questions/12651114/is-it-valid-to-put-a-period...

PHP does NOT allow periods in input names.
@see https://stackoverflow.com/questions/20575426/get-post-in-php-with-dot-in...

Note: Dots and spaces in variable names are converted to underscores. For example becomes $_REQUEST["a_b"].

From: https://www.php.net/manual/en/language.variables.external.php

If you need periods in data posted via a remote post handler, you will have to write custom code.