-
-
Notifications
You must be signed in to change notification settings - Fork 212
standardize fieldnames #8403
Comments
I have no idea what you mean. Can you post a real world code example? |
Maybe @timgatzky was talking about "file names", uploaded by the file manager? |
regular field names. Example might be over the top. But I always get requests why forms won't send and at the end it's special characters. all contao does is replacing spaces with underscore. |
I give a +1 to file names also! |
Ahh, you're talking about the form generator. Yes, that seems to be a bug, even if I didn't tried to reproduce. |
👍 fieldnames and filenames |
See also #8400 |
jup. refers to the same problem. standardize field names on save and all be fine :) |
I guess we also need
@contao/developers Which characters should we allow? |
do we really support manually creating array of fields? Does that currently work? |
Just for the record: Full ASCII (so spaces too) are perfectly valid in a "name" attribute. Here's an excerpt of the HTML specification:
But I'm fine with restricting it to alphanumerics plus |
@aschempp Yes, and AFAIR you have added this feature. 😄 |
@Toflar You are right, but some browsers replace special characters such as dot or white space with |
Problems might not occur in the name attribute of the html element but in the POST/GET variables. |
As discussed in Mumble on July 21st, we want to add a new method |
[] should not be valid! Incase you have 2 form fields: The second one will overwrite the value of the first one. In POST variables the brackets will be ignored anyways. So leave that out. Brackets can only be valid for multiple GET parameters. |
I don’t think that is true. I just tested it with this sample page: <pre><?php var_export($_POST); ?></pre>
<form action="" method="post">
<input name="foo[]" value="bar">
<input name="foo[]" value="baz">
<button type="submit">submit</button>
</form> |
Sorry, wrong screenshot of the backend. Run your test with fields name like:
Anyways. Just run a standardize over the field name value in a save_callback for that field and all is good. I don't even see a need for a validation. |
That's a configuration error IMHO. |
From Contaos point that is valid. See this as an example. I think field names should not contain brackets and should be tested unique against other field names in the same form. |
-1 Because the following is a valid configuration:
And there is no reason not to support this. |
Yes. that will work. It kinda scares me to see array keys like this. But true, that is a configuration thing |
We must keep the brackets, otherwise we will break every wizard field. |
@discordier you're confusing general input support with the input field in the Contao form manager.
|
I also like the idea of duplicate validation, l've seen that mistake and confusion before.
|
Imho [] should be allowed but stripped on duplicate validation which means the myField and myField[] mistake cannot happen :)
|
Should be fine for me, will have to wait for the final implementation, maybe I have other concerns then but currently it looks like it should work out fine. |
Fixed in 3222512. |
### 4.2.3 (2016-09-06) * Do not double URL encode the content syndication links. * Use CSS3 transforms instead of transitions to animate the off-canvas navigation. * Improve the exception handling when using the resource locator (see #557). * Correctly reset the filter menu in parent view. * Support all characters but =!<> and whitespace in simple tokens (see contao/core#8436). * Check the user's permission when generating links in the picker (see contao/core#8407). * Handle forward pages without target in the navigation modules (see contao/core#8377). * Provide the same template variables for downloads and enclosures (see contao/core#8392). * Handle %n when parsing date formats (see contao/core#8411). * Fix the module wizard's accessibility (see contao/core#8391). * Correctly initialize TinyMCE in sub-palettes in Firefox (see contao/core#3673). * Validate form field names more accurately (see contao/core#8403). * Correctly show the ctime, mtime and atime of a folder (see contao/core#8408). * Correctly index changed pages (see contao/core#8439).
I think it's better to change the name of the form field The user doesn't understand the meaning of A-Z because in german you have between A-Z also the Ä,Ö,Ü etc. or we need to but standardize and change all character from 'ä' to 'ae' like space with '_' |
I don’t think that the Umlauts are between A and Z in the german alphabet: https://de.wikipedia.org/wiki/Deutsches_Alphabet |
You are very funny. But you must understand that not all people are smart like you and me. 😃 |
If you do so, feel free to adjust the language files. I'm with @ausi: no change required here. |
@ausi LOL that was what I liked to answer. I think we should use |
Hey guys, ok forget the (Umlaut) letters but here existing a other problem. If you duplicate a form field add Contao automatically the (Kopie) on field name, but it's only A-Z0-9[]_- allowed. And also in Contao v4.4.7 by duplicating a form field stay the field name unchanged but here add Contao as label the (Kopie) with parentheses. More than one textfield with the same name attribute is strange. |
Hi,
field names should be standardized on save by default to avoid spaces or any letter that might cause trouble later on.
The text was updated successfully, but these errors were encountered: