Closed (won't fix)
Project:
Drupal core
Version:
11.x-dev
Component:
text.module
Priority:
Major
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
31 May 2016 at 14:00 UTC
Updated:
17 Nov 2025 at 15:09 UTC
Jump to comment: Most recent
Comments
Comment #2
wim leersBecause CKEditor doesn't work for
input[type=text], only fortextarea.It doesn't make sense for a tiny rectangular box with only one line of space to write huge piles of formatted text with.
Comment #3
wim leersAnd yes, this is highly confusing :( But not for CKEditor to fix.
Comment #4
wim leersSo, actually, let's move this there.
Comment #5
Bojhan commentedShould we offer this at all? This type of field? I guess it makes some sense, if you want to format something like your title?
Comment #6
wim leersI think not.
If it's HTML, it can be any HTML anyway. So it feels like the wrong solution even for that.
Comment #7
wim leersComment #8
Bojhan commentedYup, deleting this field would be a D9 thing though?
Comment #9
wim leersYes. But we can make it hidden, so that no new sites can start using this confusing field type.
Comment #10
yoroy commentedYeah, this is not a useful combination.
Don't we have this trick where we can hide it by default for new installs and have upgrade/update routines check for it being used and then enable it for existing sites?
Comment #16
pasqualleComment #17
wim leers🙏
Comment #18
tstoecklerI don't think the issue title as is is a good idea. I agree with the "symptom" of the issue that because CKEditor does not work for
textinput (onlytextarea) that the current UI is confusing or misleading.However, I disagree with the proposed solution. The problem is that due to the history of the field system, we have modelled our field types after the form widgets they can be edited with instead of considering the underlying data structure. That is why we have the distinction between "Text (formatted)" and "Text (formatted, long)" in the first place (and the same goes for the "String" field types). Both fields actually store the same data structure, so they should not be two different field types. (The fact that they use different database column types for the text is a) an implementation detail and b) based on legacy restrictions of ancient database versions so are fairly arbitrary nowadays, so should not be relevant for this decision.) We actually have an issue for removing that distinction but I can't find it right now.
And then for the scope of this issue we can still decide that we don't want to allow people to populate formatted text fields via
textinputs. We already have mechanisms in place to hide widgets under certain conditions, and possibly we need to improve those mechanisms if we come up with new use-cases here.Comment #19
pasqualleThinking about it a bit more:
Actually I use it like that a lot. I need italic and bold (and a device specific linebreak) on title fields, and need a CKEditor for that.
Switching every text field to longtext can have an impact on performance as the db storage is different, therefore removing "Text (formatted)" field might not be a good idea.
DB storage:
Text (formatted) is a VARCHAR(n)
Text (formatted, long) is LONGTEXT
Can "Text (formatted)" field have an additional widget?
Looks like I need to check the textarea_widget_for_text module. Seems too easy..
Comment #20
xjmWe would need to deprecate this first in order to remove it. So moving back to a minor branch. (It's likely to end up filed against 9.1.x a couple bulk updates from now, but putting filed in 8.8.x is how we get to that branch.) Thanks!
Comment #22
daletrexelI'm going to strongly agree with Pasqualle in #19 that there IS a use case for having a wysiwyg editor for shorter text input fields. In my case, I need limited formatting for a title field that includes
<em>and the ability to add special symbols (smart quotes, non-English characters, etc.), and the CKEditor WYSIWYG would provide non-technical content editors with the ability to do this without having to know HTML or entity codes. Because this is a short formatted text field, the "Text (formatted)" field type sounds a LOT more appropriate than either "Text (formatted, long)" or "Text (formatted, long, with summary)". It's the obvious choice for this use case, but it is NOT obvious in any of the UI that this option does not provide for the CKEditor toolbar. It just looks broken when you add a text formatter with a configured CKEditor to a "Text (formatted)" field.The initial assertion at the top of this issue that CKEditor can not be used with input[type=text] is not (no longer?) correct. You can replace any DOM object with CKEditor. In CKE4 although it is "recommended" for only
textareaanddivelements, there is a proof-of-concept that it's possible with aninput[type=text], and CKE5 seems to be even more DOM-agnostic:Since the "Text (formatted)" field CAN handle non-text HTML, etc., just fine in
input[type=text]via a properly formatted text formatter, there is no ideological reason to not also provide the same toolbar that is available to the other formattable-text fields. The main technical challenge appears to be that Drupal's implementation has baked textarea in pretty heavily, which may make expanding it to even only one other DOM element a challenge.If this field is deprecated, then the other formattable text fields should be re-named to remove the "long" descriptor, which would be both confusing and inaccurate.
It would also be REALLY helpful to have some sort of documentation for all the default field types: how the data are formatted, what they can and can not be used for, etc. Especially where similarly-named field types have different storage configurations that impact their capabilities. I looked all over and found nothing but one stackoverflow question that provided incomplete details on text formats. I'm glad that I finally found this issue, after way too much searching for information about why the CKEditor toolbar was not showing up where I expected it to.
Comment #23
daletrexelOne more follow up on how Drupal 8 sets up site builders to fail (as it did for me):
As long as the "Text (formatted)" field type remains available, but remains incompatible with the CKEditor toolbar, there needs to be some information communicated to the site builder that the text formatter's behavior and appearance will be different from the other formatted text fields.
Comment #24
pasqualleYes, it should be definitely written somewhere: if you want to use CKEditor on "Text (formatted)" field, then use the textarea_widget_for_text module.
I am wondering why it is not mentioned on the project page.
Comment #25
daletrexelThanks, Pasqualle! I just finished trying out the textarea_widget_for_text module and I can confirm that it just works, and is way too easy. Just switch the text field to the new textarea widget and the CKEditor toolbar comes along for the ride.
Looking at the module's code, it would be super easy to accommodate the "Text (formatted)" field in the existing CKEditor implementation if you simply added a condition that implements hook_field_widget_info_alter() to any input[type=text] field configured to use a text formatter for which CKEditor has been implemented. (No need to change anything if the text formatter for the field does NOT use CKEditor.) This would make the field work automatically and consistently like the other formatted text fields, without needing extra documentation pointing to the helper module or explaining why "Text (formatted)" is special.
At the moment, it looks like the CKEditor does not respect the form widgets' height configurations for ANY of the formatted text fields. That would be a very handy fix to implement as well in conjunction with this.
[Edit to add]
I just tried the CKEditorHeight module in conjunction with Textarea widget for text fields and they work great together to handle both the initial problem and my comment about CKEditor height configuration. Both would be great additions to core for making text fields and their configuration consistent and intuitive.
Comment #27
anthony.bouch commentedI'd like to add to Pasqualle and DaleTrexel's comments. We also have a need to use "Text (formatted)" restricted to italic and bold - for our scientific publication libraries. Textarea widget for text fields. Also works great. Would also add CKEditor height options that works to our wish list. "Text (formatted") seems like the appropriate choice in this case.
Comment #33
dave reid"Description" fields also make perfect sense to use with Text (Formatted) because I want to enforce a 100-300 maximum character length, but the fields may contain HTML. I don't agree about deprecating the field type, I'd rather be able to use the textarea widgets on it. I think we should take https://www.drupal.org/project/textarea_widget_for_text and make a core patch out of it.
Comment #34
dave reidI opened #3344041: Allow textarea widgets to be used for text (formatted) fields to propose allow the textarea fields for these field types in core.
Comment #35
lauriiiComment #37
smustgrave commentedKnow we are planning to deprecate #3427095: [Meta] Deprecate text_with_summary do we want to really deprecate both?
Comment #38
dalemoore commentedI'm also against deprecating this field as I'm also using the textarea widget for text fields module for the exact same use cases: for adding strong, italics, exponents, etc. in title fields, SDC props, and other short text fields where it doesn't make sense for a full textarea/longtext field. I see I commented in the other issue 2 years ago, and just want to say it still works very well. I have custom text formats explicitly limiting the number of buttons that are used in the CKEditor for these fields.
Comment #39
smustgrave commentedAgree
Text_with_summary is going to be removed so think this needs to remain.