Closed (fixed)
Project:
Drupal core
Version:
7.x-dev
Component:
node system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Dec 2012 at 09:42 UTC
Updated:
14 Jan 2014 at 01:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
plopescAttaching patch that removes the unnecessary trimming.
Regards
Comment #2
plopescChanging status
Comment #3
joachim commentedI think we still need to trim the name, which is (I think!) the human-readable label. That should get a whitespace trim as a user convenience.
It's the 'type' value trimming that can be removed in both functions.
Comment #4
plopescYou're right.
Sorry for the mistake.
Re-rolling patch.
Comment #5
joachim commentedThanks!
Looks good to me :)
Comment #6
joates commentedNote: attachment is broken (see #7)
Comment #7
joates commentedconfirm that the trim() works as required.
i added debug code to the form validation function..
as you can see from the dpm() output i have also edited the machine-name field to add the "extra" space at the front to force it to fail validation.
There may be an additional issue that the machine-name starts and / or ends with underscores when whitespace exists in the name, do we need to address that side-effect or is it acceptable ? (since the machine-name still passes the validation test)
this screenshot does work..
Note: The page title of "Error" does not relate to this issue, it just showed up on my dev build after a
git pullthis morning.Comment #8
joates commentedComment #9
plopescHello
In my opinion, the problem explained by joates is out of the scope of this issue.
The problem discovered not only affects to the node type form, because the machine name form is used in other pages such as image style creation.
In my opinion you should create a new issue related to machine_name form item validation to address this problem.
Regards.
Comment #10
joates commentedagreed..
RTBC then, patch is good !!
(and side-effect of adding underscores to machine-name is irrelevant because the machine-name still passes validation).
Comment #11
catchYes this looks sensible. Committed/pushed to 8.x.
Comment #13
David_Rothstein commentedThis isn't in Drupal 7 but has the "needs backport to D7" tag. I guess it's not that important to backport, but presumably it still could be.
Comment #14
kevin morse commentedHere we go.
Comment #15
parthipanramesh commentedLatest patch does remove redundant trim command. Thank you!
Comment #16
David_Rothstein commentedCommitted to 7.x - thanks! http://drupalcode.org/project/drupal.git/commit/9a0f281