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)
empty

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.
show input

Remaining tasks

- ( add message hints )
- reviews patch

User interface changes

show input

related issue:
#1643386: Strip useless "_" at beginning and end of JS-transliterated machine names

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

droplet’s picture

Title: Show machine name if every character is replaced Show machine name if every character is replaced » Show machine name if every character is replaced

wow. retitle

droplet’s picture

Jeffrey C.’s picture

Just an idea, maybe it should display the transliterated machine name?

droplet’s picture

@legendm33066,
It doesn't what this patch do. If machine name is transliterated / replaced, never show the inputs.

Bojhan’s picture

Wait, what does this patch do? It shows it when you put in replaced characters?

droplet’s picture

Title: Show machine name if every character is replaced » Show machine name input if every character is replaced

1. 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)

Status: Needs review » Needs work

The last submitted patch, show-machine-name.patch, failed testing.

droplet’s picture

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

Bojhan’s picture

Issue tags: -Needs usability review

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

xjm’s picture

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

chx’s picture

This is a good idea but you need a message to explain why you suddenly got a machine name to enter.

nod_’s picture

Pancho’s picture

Category: feature » bug
Priority: Normal » Major

IMHO this is a major usability bug for all CJK users, so raising priority.

Re #10:

only expose the machine name field when focus leaves the parent field.

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.

Pancho’s picture

Component: base system » forms system
klonos’s picture

We 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)?

pplantinga’s picture

Status: Needs work » Needs review

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

pplantinga’s picture

and by CJM i mean CJK

droplet’s picture

Priority: Major » Normal

Yeah. Not a major issue anymore

droplet’s picture

Issue summary: View changes

summary

alansaviolobo’s picture

Issue summary: View changes

is this still relevant?

chx’s picture

Yes. Not a biggie thanks to transliteration but a valid one.

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll
stefan.r’s picture

Issue tags: +Novice
tadityar’s picture

Status: Needs work » Needs review
FileSize
903 bytes

Attempt at re-rolling.

nod_’s picture

+        if (machine!== options.replace) {

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.

dimaro’s picture

Issue tags: -Needs reroll

Remove tag

nod_’s picture

Status: Needs review » Needs work

options is not defined either, you can use data.options.replace directly and remove the variable settings as it's not used.

tadityar’s picture

Status: Needs work » Needs review
FileSize
968 bytes
538 bytes

fixed that

nod_’s picture

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

droplet’s picture

Status: Needs review » Closed (won't fix)

Since D8 forced to use transliteration now, it doesn't needed anymore.