This issue summary has been updated March 9, 2013
This issue began in 2009, following a discussion between David Straus and chx, chx asked for a global change of the word 'textfield' with the word 'text'. Apparently it is confusing because of the new field api, 'text field' has an entirely new meaning.
In order to do this CrashTest_ created a one-liner command run from the Drupal root which does the global replacement:
find -type f -exec sed -i 's/textfield/text/g' {} \;
The patch continually failed, and missed the roll-out date for Drupal 7. This issue has been brought back up for Drupal 8, and izus created a new patch in #52. droplet believes most of these patches have been generated using one-liner commands and feels that we need to be more specific.
Next step: A new patch needs to be created for D8 to correctly define this field, as textfield != text, and cannot be used as a code-wide replacement.
| Comment | File | Size | Author |
|---|---|---|---|
| #124 | 04.11.2022_12.41.06_REC.png | 99.42 KB | gaurav-mathur |
| #120 | Screenshot from 2021-10-20 11-26-38.png | 152.57 KB | vikashsoni |
| #105 | 431812-replace_textfield_to_text-105.patch | 216.4 KB | sharique |
Issue fork drupal-431812
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #1
crashtest_ commentedRedo to fix the replacement in the field module.
Also changing the Component and Category of this task as per Berdir's recommendation.
Comment #2
damien tournoud commentedErm... no!
"Text" is also the name of a module, and the name of the field and widget it provides. This will not reduce but increase confusion.
Comment #3
chx commentedDamien, fine! Care to suggest a better name? Field should not be there. Esp not 'textfield' when have a 'text field' module....
Comment #4
dries commentedGiven that I was not part of the discussion between chx and David, I'm not sure I can make sense of this issue. Could some care to explain the finer points of the discussion?
Comment #5
chx commentedFiner points....??? My take is this: There is a text module which provides a field type text which in short everyone calls a 'text field'. But 'textfield' is a one-line input form API element. David complained originally that we do not call them 'checkboxfield' so why 'textfield' but that's imo a lesser concern than the confuson between field and form API in this regard.
Comment #6
catchtext.module isn't a great name for a module anyway - if anything we should prefix the field type modules with field_.
Comment #7
chx commentedwell that'd be good... but that does not change the problem with 'text field' and 'textfield' meaning two different things.
Comment #8
catchForgot to mention I agree with the patch itself as well as disagreeing with Damien.
Comment #9
damien tournoud commentedConsidering that there is a general agreement to rename the "text" module to something else, I can support this patch. The code itself looks ok (mostly simple replacements of
'#type' => 'textfield'to'#type' => 'text'), but:* The patch changes the "textfield" profile type to "text", which means that we need an upgrade function
* The following replacements result in strange grammar:
Comment #11
crashtest_ commentedFixed the grammatical issues, and created an update to change the database items in profile_field.type from 'textfield' to 'text' in profile.install.
Comment #12
xmacinfoI did a quick scan of the latest patch. The grammar is a lot better and makes sense.
I did not apply the patch, though. But I guess it's ready to RTBC provided someone takes the time to apply the patch properly.
Comment #14
cburschkaThere is only one failed hunk in the patch. It is caused by a code-style error in the affected lines, which has been fixed in the meantime.
Here is a re-rolled patch.
... mh. There's something wrong here; the patch is 10KB larger than the previous one. I know that I diffed a clean working copy. What gives?
Comment #15
crashtest_ commentedUpdate to the patch to make it apply again.
Comment #16
cburschka... I think the server has a hickup.
Anyway, I found out the reason for the 10KB.
and
Differ by approximately 180 byte in size. 55 files were modified. 50*200 = 10kB.
Comment #17
cburschkaComment #19
sunHaving 'text' and 'textarea' does not look like an improvement to me.
'text' might only work if the form element widget would be dynamic, i.e. depending on certain properties, it either becomes a one-line text input field or a multi-line textarea - effectively meaning that 'textarea' would be dropped. Although I am not sure whether that makes sense and does any better.
We also need to take #414424: Introduce Form API #type 'text_format' into account.
That said, I don't really understand why text.module has to provide two new form element #types 'text_textfield' and 'text_textarea', which - logically - are the same form #type elements as the existing #types...?
Comment #20
cburschkatextarea and input are so radically different kinds of markup, and are handled in such different ways by browsers, that I don't think they should be lumped into one "magic" Form API element.
Considering the markup of HTML forms, "text" makes much sense. All other form API elements are named after their type attribute (for "input" elements like checkbox, radio, submit) or their element name ("select", "textarea").
No idea why. It seems to be the standard for almost all CCK widgets to reference a self-defined custom form element - even for simple form elements like text, radio options, etc.
Comment #21
chx commentedArancaytar is right, that's what this issue is about: rename textfield to text so that it is a) consistent with the HTML b) it's not called a field.
Comment #22
chx commentedWhat happened to this one?
Comment #23
sunI withdraw my previous statement due to Arancaytar's reasoning. Mapping to DOM element types makes sense.
Though the text_* #type duplication issue remains, but that doesn't belong into this issue.
Comment #24
sunTagging.
Comment #25
cburschkaI'm merging #15 across the four intervening months right now.
Comment #26
cburschkaThis patch applies to HEAD again.
However, it is incomplete. After applying this patch, another careful replacement will have to be done.
Edit: It seems that some of the instances in the field_ui and text.module files will stay. However, there are some others that do have to be changed.
Comment #28
cburschkaThis one should fix some of the failures. I've left the text_textfield and related stuff unchanged.
Comment #30
cburschkaThis one required no manual merging, just an update of the patched code-base.
Comment #32
cburschkaThis is breaking faster than I can keep up.
Blogapi's removal this time.
Comment #33
crashtest_ commentedThanks for keeping up on the patch Arancaytar!
Comment #35
cburschkaRemerged.
Comment #37
cburschka#394182: DBTNG search.module broke HEAD. Re-test.
Comment #39
sun.core commentedComment #40
cburschkaNo no, this time the testbot has it right. File field added a couple of textfield form elements that have to be replaced.
Comment #42
cburschkaLocal copy didn't diff modules/file for whatever reason. Maybe third time's the charm.
Comment #43
sunIntroducing a new tag for feature freeze: API clean-up.
Comment #45
effulgentsia commentedToo late for D7. Let's try again in D8.
Comment #46
rickmanelius commentedPinging. Obviously there was a lot of passion on this one and it can be done now before the next string freeze :)
Comment #47
karschsp commentedHere's an updated patch. Let's see what testbot thinks.
Comment #48
frobPatch fails. directory structure has changed. [/includes no longer exists]
Comment #49
karschsp commentedHere's an updated patch which accounts for the /core move.
Comment #50
Niklas Fiekas commented#49: textfield-text-049.patch queued for re-testing.
Comment #52
izus commentedHello,
Submitting a new patch generated with the last codebase.
Hopefully it goes green !
Comment #53
izus commentedComment #54
droplet commentedSeems like all these patches generated from "one-liner command"
most of them are very bad changes.
eg:
Are they changing the meanings ?
textfield == text field
textfield == text input
textfield == text form element
BUT
textfield != text
Comment #55
scresante commented#52: rename_textfield_to_text-431812-52.patch queued for re-testing.
Comment #56.0
pzula commentedpzula added a new issue summary for d8
Comment #57
pzula commentedUpdated the issue summary
Comment #58
scresante commentedThis is riddled with rejections, I'll see what I can do in an hour to fix it up. ALOT has changed since last july.
Comment #59
scresante commentedThese issues with the wording of 'text field' in no way warrant a global s/textfield/text/g on the entire code base. On top of that, this patch is absolutely unmaintainable with its broad reach given the current pace of D8 development. It will end up breaking far too many things, and is not worth the effort.
I could understand if the scope of this issue was narrowed and was just a patch against some unclear description of a field in an admin form. But this is so broad reaching (s/textfield/text/g) and seems very misguided.
Are the chx's issues raised above truly impediments to either UX or development in any way? If not, I'd recommend close: won't fix.
Comment #59.0
scresante commentedpzula updated summary
Comment #60
drupaldrop commentedAdding a new patch
Comment #61
drupaldrop commentedComment #62
adci_contributor commentedComment #64
xmacinfoComment #65
robertoperuzzoI'm working on it now.
Comment #66
robertoperuzzoComment #67
robertoperuzzoComment #68
segi commentedComment #69
alimac commentedWe should all try and use the same sprint tag. According to https://groups.drupal.org/node/447258 it should be SprintWeekend2015 with no #.
Comment #70
piyuesh23 commentedComment #71
rahulbaisanemca commentedComment #72
adci_contributor commentedPLEASE IGNORE;
Comment #74
adci_contributor commentedTry to reroll.
Not shure about some tests which uses 'textfield' value as name for items.
Please review.
Comment #76
alvar0hurtad0IMHO it's better unassigned.
@rahulbaisanemca if want to do the reroll, reassign it, please.
Comment #77
nitesh sethia commentedComment #78
nitesh sethia commentedRerolling.
Comment #79
nitesh sethia commentedComment #81
nitesh sethia commentedComment #82
nitesh sethia commentedComment #84
rpayanmComment #86
joshi.rohit100Comment #88
joshi.rohit100Now atleast php error is gone :)
Comment #89
rpayanmThe error was a new line before <?php tag.
Comment #93
sharique commentedThis should fix few tests.
Comment #95
sharique commentedHere is missing interdiff file.
Comment #96
cosmicdreams commentedHi, I've found this issue. Looks like all references to text_textfield were overlooked. Investigating...
Comment #99
Patrick Storey commentedI am removing the Novice tag from this issue because it was added back in 2009, this issue has changed version numbers, and the comments are closing in on triple digits. That is a lot of comments to read through for new contributors.
I’m using this documentation as a source: https://www.drupal.org/core-mentoring/novice-tasks#avoid
Comment #100
segi commentedI re-rolled the patch.
Comment #101
segi commentedComment #103
sharique commentedFixing syntax error in last patch.
Comment #105
sharique commentedComment #107
sharique commentedSubmitting to test bot again to have updated test failure list.
Comment #108
cilefen commentedA normal-priority Task must go in 8.1.x, usually.
Comment #120
vikashsoni commented@Sharique Patch is not working in drupal-9.3.x-dev
Needs to re-roll for this version for ref sharing screenshot
Comment #124
gaurav-mathur commented- Patch #105 is not working in drupal 10 version.
- Needs to re-roll for this version.
- Attaching screenshot for reference.
Comment #125
nod_Patch or MR doesn't apply anymore
The last patch or MR doesn't apply to the target branch, please reroll the code so that it can be reviewed by the automated testbot.
D10 version needed
At this time we would need a D10.1.x patch or MR for this issue.
Comment #126
bhanu951 commentedComment #128
bhanu951 commentedBefore proceeding further I would like to have some input on how to proceed with textfield string yml,css,js files ?
For now I replaced textfield to text in .php files.
Comment #129
nod_Comment #130
longwaveA global find and replace is too broad; several comments have been changed that don't make sense.
We also need to consider backward compatibility, we need to support both text and textfield until the next major version.
I even think this might have to be won't fix, as there is probably contrib/custom code somewhere that relies on
#type => 'textfield'and I don't see a way of handling that in a backward compatible manner; not sure the benefit outweighs the disruption here.Comment #131
nod_I'd be fine with that, up to the committers to make a call on this :)
Comment #132
frobWouldn't we just leave the existing textfield type in place as an extension of the text type?