Problem/Motivation
Machine name is a *Mandatory* input.
If every character is replaced, there is no default value generated for the machine name.
For example,
Type in "(any CJK characters)", Drupal will generate a *empty* machine name. (no value, nothing)
It has 2 major problem:
- Users may think that Drupal will set a default value for them.
- For CJK users, everytime creating a new field, content type, etc, they have to click the EDIT link once. It is not user friendly.
Proposed resolution
When every charachter is replaced, it will show the machine name input to users, and ask them to type in the name manually.
Remaining tasks
- ( add message hints )
- reviews patch
User interface changes
related issue:
#1643386: Strip useless "_" at beginning and end of JS-transliterated machine names
Comment | File | Size | Author |
---|---|---|---|
show-input.jpg | 40.29 KB | droplet | |
empty.jpg | 12.88 KB | droplet |
Comments
Comment #1
droplet CreditAttribution: droplet commentedwow. retitle
Comment #2
droplet CreditAttribution: droplet commentedComment #3
Jeffrey C. CreditAttribution: Jeffrey C. commentedJust an idea, maybe it should display the transliterated machine name?
Comment #4
droplet CreditAttribution: droplet commented@legendm33066,
It doesn't what this patch do. If machine name is transliterated / replaced, never show the inputs.
Comment #5
Bojhan CreditAttribution: Bojhan commentedWait, what does this patch do? It shows it when you put in replaced characters?
Comment #6
droplet CreditAttribution: droplet commented1. User types in "A" (assume it's a non-latin char)
2. "A" replaced into "_". (druapl thinks "_" is EMPTY)
3. Shows "machine name" near to Name input (see #0 img, user may think drupal provide a default value)
4. User submit
5. hit errors.
This patch going to show "machine name input" when user types in non-latin (a-z, 0-9, __) chars.
1. User types in "ABC"
2. "ABC" replaced into "_"
3. Shows "machine name input" apparently
4. (see #0 images)
Comment #8
droplet CreditAttribution: droplet commentedI have no idea how to explain it more clearly. (sorry my bad english)
this image in other issue may help
http://drupal.org/files/machinename_0.jpg
- Show edit button only:
user may leave as it (think that system use default value), but non-english will not provide a default value, so gets error.
- Show inputs "*" (Mandatory field)
empty value, they try to type in something.
(http://drupal.org/node/1065626#comment-5723440)
Comment #9
Bojhan CreditAttribution: Bojhan commentedNot really sure if this is very desirable, it should maybe take a second before it hops into showing mode. Because if I start with 02_.... it shouldn't collapse straight away, if only 0.5 seconds after that I type 02_frame.
Comment #10
xjmI agree with #9. When I tested a patch with this behavior in the other issue, I found the instant shift to the machine name field jarring and disorienting. I think it would be better to have a significant delay and keep the cursor in place--or even only expose the machine name field when focus leaves the parent field.
Comment #11
chx CreditAttribution: chx commentedThis is a good idea but you need a message to explain why you suddenly got a machine name to enter.
Comment #12
nod_Related: #1643386: Strip useless "_" at beginning and end of JS-transliterated machine names
Comment #13
PanchoIMHO this is a major usability bug for all CJK users, so raising priority.
Re #10:
This sounds like a much better, less distracting, idea.
In a followup, we might also evaluate whether it is desirable to extend this behaviour to other cases of machine names lacking specifity.
Comment #14
PanchoComment #15
klonosWe now have #567832: Transliteration in core and #1842718: Use new Transliteration functionality in core for machine names. Should we use that first (and also allow user to edit the auto-transliterated machine name)?
Comment #16
pplantinga CreditAttribution: pplantinga commentedLike klonos said, this is no longer an issue for CJM because of #1842718: Use new Transliteration functionality in core for machine names
It's only an issue if someone wants to name a field #$%^& or something. Perhaps this is a rare enough use case that these people can enter their own machine name?
Comment #17
pplantinga CreditAttribution: pplantinga commentedand by CJM i mean CJK
Comment #18
droplet CreditAttribution: droplet commentedYeah. Not a major issue anymore
Comment #18.0
droplet CreditAttribution: droplet commentedsummary
Comment #19
alansaviolobo CreditAttribution: alansaviolobo commentedis this still relevant?
Comment #20
chx CreditAttribution: chx commentedYes. Not a biggie thanks to transliteration but a valid one.
Comment #21
jhedstromComment #22
stefan.r CreditAttribution: stefan.r commentedComment #23
tadityar CreditAttribution: tadityar commentedAttempt at re-rolling.
Comment #24
nod_space after machine missing here :)
options is not defined either, you can use
data.options.replace
directly and remove the variable settings as it's not used.Comment #25
dimaro CreditAttribution: dimaro at La Drupalera by Emergya commentedRemove tag
Comment #26
nod_options
is not defined either, you can usedata.options.replace
directly and remove the variablesettings
as it's not used.Comment #27
tadityar CreditAttribution: tadityar commentedfixed that
Comment #28
nod_The patch doesn't work properly, now the machine name input shows up all the time.
On the other hand, if we don't change anything and I type some japanese text, the transliteration works and the machine name is not empty. The form can be submitted without error.
I think this issue can be closed as "works as designed". can you confirm droplet (or anyone else)?
Comment #29
droplet CreditAttribution: droplet commentedSince D8 forced to use transliteration now, it doesn't needed anymore.