Problem/Motivation

The Summary part of the textfield should have a WYSIWYG Editor because the format applies to body and summary.

Proposed resolution

@todo
- Lock down the format for summary in the widget. (?)

Remaining tasks

  1. Update this summary to accurately reflect the proposed change.
  2. Fix the existing test failures.
  3. Add new tests to cover the new functionality.
  4. Move this back to 'Needs review'
  5. Reviews/refinements.
  6. RTBC.
  7. Commit.

User interface changes

WYSIWYG editor available on the separate 'Summary' field on text areas that support them.

Before

After

API changes

TBD.

Data model changes

TBD, hopefully none.

CommentFileSizeAuthor
#161 ckeditor-for-summary-2671162-11.3.x-161.patch7.97 KBjrglasgow
#159 summary-format-2671162-159.patch16.75 KBfoxy-vikvik
#157 2671162-158.patch7.98 KBzeeshan_khan
#151 2671162-151.patch16.73 KBjunaidpv
#143 2671162-143.patch16.73 KBIbrahimTameme
#142 2671162-nr-bot.txt90 bytesneeds-review-queue-bot
#138 2671162-138.patch16.15 KBrahaf albawab
#132 drupal-n2671162-132.patch15.79 KBdamienmckenna
#122 2671162-11.x-122.patch16.36 KBhanoii
#116 2671162-9.5.x-116.patch24.02 KBalexpott
#114 2671162-114.patch23.19 KBcslevy
#108 2671162-108.patch25.6 KBalexpott
#108 89-108-interdiff.txt8.08 KBalexpott
#103 2671162-103-9.3.x-test-editor-for-summary-field.patch22.3 KBjrglasgow
#102 2671162-102-9.4.x-test-editor-for-summary-field.patch21.96 KBjrglasgow
#102 2671162-102-9.3.x-test-editor-for-summary-field.patch22.33 KBjrglasgow
#101 2671162-100-9.4.x-test-editor-for-summary-field.patch22 KBjrglasgow
#101 2671162-100-9.3.x-test-editor-for-summary-field.patch22.33 KBjrglasgow
#99 Screenshot_20220125_112632.png35.92 KBakalam
#97 2671162--after--patch--pic.png28.65 KBvikashsoni
#97 2671162--before--patch--pic.png19.63 KBvikashsoni
#94 Screeshot-2671162-89.patch-After-Patch-9.4.x.png188.33 KBimmaculatexavier
#94 Screeshot-2671162-89.patch-BeforePatch-9.4.x.png136.58 KBimmaculatexavier
#89 2671162-89.patch17.52 KBalexpott
#84 After-patch-summary.png239.55 KBMadhu kumar
#84 before-patch-summary.png245.81 KBMadhu kumar
#82 Screenshot 2021-05-21 at 12.51.08.png68.94 KBgauravvvv
#82 Screenshot 2021-05-21 at 12.50.42.png64.23 KBgauravvvv
#79 interdiff_77-79.txt836 bytesvsujeetkumar
#79 2671162_79.patch17.62 KBvsujeetkumar
#77 interdiff_76-77.txt274 bytesvsujeetkumar
#77 2671162_77.patch17.04 KBvsujeetkumar
#76 2671162_76.patch17.18 KBcslevy
#73 interdiff_62-73.txt15.26 KBvsujeetkumar
#73 2671162_73.patch17.81 KBvsujeetkumar
#67 interdiff_61-67.txt4.11 KBnikitagupta
#67 2671162-67.patch12.65 KBnikitagupta
#62 2671162-61.patch7.92 KBnaresh_bavaskar
#60 2671162_60.patch8.64 KBbaher
#2 2671162-1.patch908 byteswebflo
#4 2671162-4.patch2.23 KBwebflo
#5 isssue-2671162.jpg176.57 KBwebflo
#23 use-text-editor-for-summary-field-2671162-23.patch8.26 KBjunaidpv
#27 patch-on-fresh-d8.7.5.png75.8 KBjunaidpv
#40 2671162-40.patch8.08 KBjayprakash01
#45 2671162_45.patch11.16 KBvsujeetkumar
#45 interdiff_40-45.txt2.79 KBvsujeetkumar
#46 text-editor-for-summary_D8.9.x-2671162-45.patch11.33 KBsteveoriol
#47 2671162_47.patch11.41 KBvsujeetkumar
#47 interdiff_45-47.txt1.73 KBvsujeetkumar
#50 2671162_50.patch10.11 KBvsujeetkumar
#50 interdiff_47-50.txt3.92 KBvsujeetkumar
#51 2671162_51.patch10.99 KBvsujeetkumar
#51 interdiff_50-51.txt721 bytesvsujeetkumar
#52 2671162_52.patch11.78 KBvsujeetkumar
#52 interdiff_51-52.txt627 bytesvsujeetkumar
#55 2671162-after_patch-52.png58.73 KBabhijith s
#55 2671162-before_patch-52.png71.78 KBabhijith s
#59 2671162_58.patch5.67 KBbaher

Issue fork drupal-2671162

Command icon 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

webflo created an issue. See original summary.

webflo’s picture

StatusFileSize
new908 bytes

The patch does not work for new entities, because the default format is computed in TextFormat::processFormat later.

webflo’s picture

Issue summary: View changes
webflo’s picture

StatusFileSize
new2.23 KB
webflo’s picture

Issue summary: View changes
StatusFileSize
new176.57 KB
swentel’s picture

So will the editor on the summary change if you change the format of the body ?

wim leers’s picture

#6 It could and should not, because the summary can be edited independently of the actual body.

dhaval_panara’s picture

Assigned: Unassigned » dhaval_panara
Issue tags: +drupalcon2016

I am looking into this issue.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

demonde’s picture

Any news here?

wim leers’s picture

Title: Initialize CKEditor for summary part of a textfield » Also use text editor (CKEditor) for "summary" of a text field
Category: Bug report » Feature request

I've said this before: we should've gotten rid of the "text with summary" field instead. If you want a summary, create a separate field.

demonde’s picture

Isn't it better to fix this and discuss such changes of the core in a separate issue for 9.x?

damienmckenna’s picture

Assigned: dhaval_panara » Unassigned

No progress in almost a year, I'm unassigning it.

wim leers’s picture

#13: Probably. If you work on a patch I'd be happy to provide reviews.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

generalconsensus’s picture

@Wim Leers, @DamienMcKenna. I've run into an issue with using this patch which I would love to solve to move this along. Since the summary is considered an instance of StringInterface when it's validated
here: core/lib/Drupal/Core/Validation/Plugin/Validation/Constraint/PrimitiveTypeConstraintValidator.php:35, it fails due to these two validation issues:

!is_scalar($value) && !($value instanceof MarkupInterface)

with the following error:

This value should be of the correct primitive type.

ao2’s picture

This would be a nice addition, I'd just like to mention that usability-wise we'd be hitting #2877527: Make CKEditor (approximately) reflect the rows setting of a field as the summary and body textareas end up having the same height.

About having two separate fields like suggested in #12, some related issues are #1529188-15: Provide separate text format for summary in long text with summary fields and #1378350: Clean up the "Long text and summary" field but I have not found one which addresses the problem of the synchronization between these two separate fields to cover the case when the summary is empty.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

junaidpv’s picture

Tried patch from #4 and get error as mentioned in #18. I attempted several hacks and none worked. I even tried to create new field type just for summary field, that also did not work. For me D8 looks more resistant to hacks.

Now I have patch for core editor module. It is mostly on JS side in editor.js and some in Element.php.

Idea is to attach editor to more than one textarea same time. As you see in patch for Element.php. It add ID of summary field as well if summary field is present. modification in editor.js is to make it manage more than two editor same time for single format selector.

There is one issue with this patch. Patch will not work if format is changed by selecting "Format" select box. But that does not matter in our case as on all our sites we are using single text format per textarea field. So, not essential for us to fix it at this moment.

ivnish’s picture

Patch #23 doesn't work for me :(

junaidpv’s picture

@ivnish did patch apply cleanly?
Also, are you getting any JS error in browser console?

ivnish’s picture

Patch applied successful. No js errors in console.

I will try this patch on fresh drupal site

junaidpv’s picture

StatusFileSize
new75.8 KB

@ivnish Just confirmed the patch is working on fresh D8.

  1. Downloaded latest Drupal 8.7.5 from https://www.drupal.org/project/drupal/releases/8.7.5
  2. Made a regular installation with "Standard" profile. (No composer, no drush. Just old way using browser)
  3. Put patch on D8 root folder and applied.

Got it working straight away as in this screenshot CKeditor on summary field.

ivnish’s picture

On my site I have only one text format. Can it affects?

junaidpv’s picture

@ivnish That is perfect site for this patch. The patch will work fine for your site.

Also, you may have more than one text format in your site but only one text format to be allowed on a field to make this patch work on that field.

chris pergantis’s picture

We have applied the patch to a Drupal 8.7.5. It is not a clean/new install.
We also patched an almost bare 8.7.6 install (had a few contributed modules installed.)
We then reinstalled that bare 8.7.6 as an 8.7.7 to make it a clean install.
The patch is not working on anything but the clean install.
Why is it not working on the modified sites?
We are asking this because we can't start the site over.
If we know the reason for requiring a cleanly installed site and what might be wrong when installing on a modified site we can try to find a solution.

junaidpv’s picture

@Chris, there is no requirement for clean installed site for the patch from comment #23 to work.

In fact we are using this same patch in our production site that exist since Drupal 5 or 6. Currently it runs on 8.7.4. Later I will try to update here if patch continues to work after updating site to latest D8.

I assume, there might be something in your site that conflicts with the patch.

tamerzg’s picture

Status: Active » Reviewed & tested by the community

Patch in #23 worked for me on 8.7.8 on my existing site (not fresh install).

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 23: use-text-editor-for-summary-field-2671162-23.patch, failed testing. View results

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

steveoriol’s picture

Patch in #23 worked for me too on D8.7.8

TD44’s picture

Commit please

dww’s picture

Issue tags: +Needs tests

Thanks for the folks who've worked on this so far. I agree this would be a good improvement.

@TD44: Comment #36 is entirely unhelpful. There's nothing to commit. Patch #23 causes existing tests to fail, and has no tests of its own. This isn't even in 'Reeds review', much less 'RTBC'. Core committers should not waste their time in here until the community gets something actually commit-able ready, first.

Tagging for 'needs tests' (new tests to prove the new functionality works).

Still 'Needs work' status b/c of the existing test failures in https://www.drupal.org/pift-ci-job/1425970

Cheers,
-Derek

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

steveoriol’s picture

On Drupal 8.9.3, the patch in #23 applies without errors, but it no longer works.
it generates java-script errors like:
Uncaught TypeError: field.each is not a function

web/core/modules/editor/js/editor.js on line 187 >> field.each(function() {

jayprakash01’s picture

Status: Needs work » Needs review
StatusFileSize
new8.08 KB

Reroll patch for 9.1.x. Please review

Status: Needs review » Needs work

The last submitted patch, 40: 2671162-40.patch, failed testing. View results

dww’s picture

@all: Please don't set this issue to 'Needs review' or say "Please review" until:

a) The existing test failures are fixed. You can run these tests locally and get them working before you upload a patch.
b) You add new tests (that pass) that verify the new functionality.

If you fix (a) but don't have the time/knowledge to solve (b), that's totally fine. Please upload your patch once you've gotten the tests passing locally, with an interdiff relative to the latest patch. You can manually trigger testing for your patch, even if the issue is not in 'Needs review' status. Then we can all see that the existing test failures are resolved, which would be big progress! But there's no sense "please review"'ing this issue until the current tests are passing, we also have new tests, and can accurately remove the 'Needs tests' tag.

Other things you can do to move this forward that would help get this out of 'Needs work' status:

  1. Create before screenshot of a summary from a text area, showing the existing UI. Attach that to the issue and embed it in the User interface changes section of the summary to replace the @todo I just put there. Might be worth updating the 'After' screenshot, too, so that we see exactly the same text area before/after. Once that's done, you can remove the 'Needs screenshots' tag.
  2. Update the summary to fully describe the proposed change here, removing the other @todo items I'm adding here. Once complete, remove the 'Needs issue summary update' tag.

Thanks!
-Derek

jayprakash01’s picture

Apologies, was trying some hands -on on Community for first time , will take care going forward . Thanks for your note

dww’s picture

@jayprakash01: No worries! Thanks for moving this forward, and apologies if I came across harshly. Not at all intended. Was trying to clarify how we use the Status and 'Issue tags' fields to keep things organized, and to provide action items that'll help.

Cheers,
-Derek

p.s. I'll add that there's also no need to queue a patch for testing on multiple platforms/configurations except in very rare circumstances (e.g. you reasonably expect it to be PHP version or DB dependent). Certainly not worth it if there are known test failures. Each test run takes ~1.25 hours of AWS time, which the Drupal Association pays for. So we try to be mindful of that cost and only have the testbot do work that's really necessary. Thanks again, and welcome to Drupal core development! :)

vsujeetkumar’s picture

StatusFileSize
new11.16 KB
new2.79 KB

Fixing test.

steveoriol’s picture

The D8.9.x version, but it still doesn't work when trying to change the text edition format when you edit the node...

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new11.41 KB
new1.73 KB

@dww I also face issue mention in #39 for drupal 9.1.x, I have done some changes now issue has been fixed, Please review and advise.

Status: Needs review » Needs work

The last submitted patch, 47: 2671162_47.patch, failed testing. View results

alex.mazaltov’s picture

Assigned: Unassigned » alex.mazaltov

I was looking to repo of drupal project and found latest commits related to this issue.
I hope i can get friendly support to get familiar with core contribution and writing tests.
What i can say looking to dispatcher while process was performing for latest patch posted in #47 that it fails Tests for CKEditor
FATAL Drupal\Tests\media\FunctionalJavascript\CKEditorIntegrationTest: test runner returned a non-zero error code (2).
I think is a good point to enter for me into whole process of contribution to core, performing local execution of Unit Tests and other related stuff like fixing, debugging, patching, gitting.

I am assigning this issue to me hopefully that i can get support from @vsujeetkumar
May i ask about mentoring me or pair programming somebody to investigate perform and fix this issue?

vsujeetkumar’s picture

StatusFileSize
new10.11 KB
new3.92 KB
vsujeetkumar’s picture

StatusFileSize
new10.99 KB
new721 bytes

Fixing Test

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new11.78 KB
new627 bytes

@dww, Issue has been fixed mentioned in #39, Also test, Please review.

alex.mazaltov’s picture

I have queued test for branch 8.9.x-dev. @vsujeetkumar, as far as i understand this issue is no longer exists in drupal version 8, so this patch is not applicable to branch 8.9.x.

Then only manual testing is requres to make sure this fix could be commited to core.

mirom’s picture

Hey folks, do you think it's a good idea to change this without possibility to opt-out? We (and I think we're not alone) rely on summary having no html code and it would break our code. I also noticed on screenshot that there is no possibility to change text format. So is text format inherit from main body field? I think this would be confusing from UX perspective.

abhijith s’s picture

StatusFileSize
new58.73 KB
new71.78 KB

Applied patch 52 . Now the summary field is also appearing as a WYSIWYG Editor
before patch:
before
after patch:
after

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

tanubansal’s picture

Tested #52 on 9.1, Summary field is appearing with an Editor after the patch
This can be moved to RTBC

baher’s picture

Hi,

#52 failed on 8.9.x.

Baher

baher’s picture

StatusFileSize
new5.67 KB

Hi,

I create this patch 2671162_58.patch based on the patch 2671162-after_patch-52.patch for 8.9.x. Can you tested.

Baher

baher’s picture

StatusFileSize
new8.64 KB

Hi,

Sorry the last patch is missing a file. It will work on 8.9.x version.
You can test this one.

Baher

naresh_bavaskar’s picture

Assigned: alex.mazaltov » naresh_bavaskar
Status: Needs review » Needs work
naresh_bavaskar’s picture

Assigned: naresh_bavaskar » Unassigned
Status: Needs work » Needs review
StatusFileSize
new7.92 KB

Re-rolled the patch for 9.2.x

Status: Needs review » Needs work

The last submitted patch, 62: 2671162-61.patch, failed testing. View results

steveoriol’s picture

The patch #60 looks good for me on a D8.9.8

sershevchyk’s picture

Patch #62 works fine for me on a D9.1.0

jayprakash01’s picture

nikitagupta’s picture

Status: Needs work » Needs review
StatusFileSize
new12.65 KB
new4.11 KB

Lukey made their first commit to this issue’s fork.

brobert7’s picture

#67 is working for me on Drupal 9.1.3

vsujeetkumar’s picture

StatusFileSize
new17.81 KB
new15.26 KB

I have reviewed and found some JS issues, Now it has been fixed along with some tests and cs issues, Also #67 is not applying on 9.2.x, So I have created interdiff with #62 because its working patch for 9.2.x. Please have a look and advise.

seanr’s picture

I can't get either of the last two patches to apply to 9.1.6. :(

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

cslevy’s picture

StatusFileSize
new17.18 KB

I recreated the patch, which applies on 9.1.8 as well

vsujeetkumar’s picture

StatusFileSize
new17.04 KB
new274 bytes

Fixed custom command fail issue for 9.1.x, Please have a look.

Status: Needs review » Needs work

The last submitted patch, 77: 2671162_77.patch, failed testing. View results

vsujeetkumar’s picture

Status: Needs work » Needs review
StatusFileSize
new17.62 KB
new836 bytes

Fixed fail test for 9.1.x, Please have a look.

manojithape’s picture

Assigned: Unassigned » manojithape
manojithape’s picture

Assigned: manojithape » Unassigned
gauravvvv’s picture

Patch #79, seems fine to me. Adding before and after patch screenshot for reference.

After #79, tags are available as per the body section.

gauravvvv’s picture

Issue summary: View changes

Updated IS

Madhu kumar’s picture

StatusFileSize
new245.81 KB
new239.55 KB

Patch #79 applied cleanly working as expected , sharing screenshot for reference.

frankdesign’s picture

Patch at #79 doesn't seem to be working for Drupal 9.2.4. Patch applied no problem, but still no CKEditor on Summary field. Am I missing something?

** Ignore that - just updated to 9.2.5 and it's working. Thanks for the patch.

bradallenfisher’s picture

The patch applied clean to 9.2.6 but does not change the summary field to CKEditor

webdrips’s picture

#79 worked for me on 9.2.7

drupaldope’s picture

drupal 9.2.8 patch#79 didn't apply

or did I do a mistake:
"drupal/core": {
"wysiwyg_in_body_summary": "https://www.drupal.org/files/issues/2021-05-06/2671162_79.patch"
}

alexpott’s picture

StatusFileSize
new17.52 KB

Here's a reroll for 9.3.x and 9.4.x.

Status: Needs review » Needs work

The last submitted patch, 89: 2671162-89.patch, failed testing. View results

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

immaculatexavier’s picture

I am making screenshots.

drupaldope’s picture

I can confirm the patch is working as expected for me
9.3.2

immaculatexavier’s picture

2671162-89.patch was applied to Drupal 9.4.x. I can confirm that the patch does not function as intended after applying the patch, I can confirm that the patch does not work as expected.
For your convenience, I've attached the Before and After Patch Screenshots.

Before Patch Screenshot:

Before Patch

After Patch Screenshot:

After Patch

immaculatexavier’s picture

2671162-89.patch was applied to Drupal 9.4.x. I can confirm that the patch does not function as intended after applying the patch, I can confirm that the patch does not work as expected.
For your convenience, I've attached the Before and After Patch Screenshots.

immaculatexavier’s picture

Issue tags: -Needs screenshots
vikashsoni’s picture

StatusFileSize
new19.63 KB
new28.65 KB

Applied #89 patch in drupal-9.3.x-dev
After patch i don't see any changes i am getting same result before and after patch
for ref sharing screenshot ....

drupaldope’s picture

yes, it works in 9.3 but apparently not in 9.4

akalam’s picture

StatusFileSize
new35.92 KB

I confirmed it works on 9.3.x
Issue 2671162

jrglasgow made their first commit to this issue’s fork.

jrglasgow’s picture

Status: Needs work » Needs review
StatusFileSize
new22.33 KB
new22 KB

here is my attempt at re-rolling that patch for both 9.3.x and 9.4.x

jrglasgow’s picture

ok, those last patches had typos, I fixed them

jrglasgow’s picture

StatusFileSize
new22.3 KB

missed removing that typo in the 9.3.x patch file

liquidcms’s picture

#79 is the only patch i have been able to get to apply to 9.2.11; and sadly it doesn't do anything.

Also, as part of this effort, shouldn't body/summary allow for different editors? I guess in core the best we could hope for is setting default editor for each and would need to modify something like Better Formats module to limit each to specific editors.

As an example use case of this; for the Summary i want a very limited editor with specific character count limit (CK plugin).

liquidcms’s picture

hmm.. oddly enough it seems to be working now. #79 patch and 9.2.11 - but still need to specify different editors for summary/body - but this looks like a great place to start. thanks.

gauravvvv’s picture

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

alexpott’s picture

StatusFileSize
new8.08 KB
new25.6 KB

Here's a reroll of #89 against 9.4.x with some fixes for the CkEditor5 tests.

Status: Needs review » Needs work

The last submitted patch, 108: 2671162-108.patch, failed testing. View results

felubra’s picture

#108 is working in Drupal 9.4.0.

webdrips’s picture

Hmmm #108 is working for me on one site, and not working on another. The one it's not working on has 20 other core patches, but then none of them have anything to do with CKEditor.

steveoriol’s picture

Patch #108 does not apply anymore with Drupal 9.4.8...

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

cslevy’s picture

StatusFileSize
new23.19 KB

Patch re-roll to apply on the latest 9.5.x and 9.4.8

jcmartinez’s picture

@cslevy your patch re-roll works. I owe you a beer. Thank you!

Patch #114 applies now.

alexpott’s picture

Status: Needs work » Needs review
StatusFileSize
new24.02 KB

Here's a patch for 9.5.x

Status: Needs review » Needs work

The last submitted patch, 116: 2671162-9.5.x-116.patch, failed testing. View results

damienmckenna’s picture

Have confirmed that #116 works well on 9.5.x.

There is some test coverage included in the patch, so is additional test coverage required?

hetal.solanki’s picture

#116 is working in Drupal 9.5.2

Thank You!!

karoda_manoj’s picture

Does any one have solution for this issue ? I want to use ckeditor5 in summery field in drupal 9.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

hanoii’s picture

StatusFileSize
new16.36 KB

I applied #2671162-116: Also use text editor (CKEditor) for "summary" of a text field on 11.x and manually edit the editor.js file as the es6 file was removed.

Also, some of the test files modified on the patch there were removed in #3270438: Remove CKEditor 4 from core so leaving the other tests.

EDIT: Applies OK to 10.0.9 and likely 10.1.x as well

vasike made their first commit to this issue’s fork.

vasike’s picture

Status: Needs work » Needs review

latest patch seems not to apply anymore

re-rolled and created a new MR from it ...

let's see what happens.

smustgrave’s picture

Status: Needs review » Needs work

Also for open tags

gauravvvv’s picture

Fixed linting error in editor.js file.

sir_squall’s picture

Do we have a patch who is working well for the last drupal 9 version?

sir_squall’s picture

I just tested the patch #122 in drupal 10, and it's working well

oierbravo’s picture

Tested #122 with 10.1.3 and works as intended.

phily’s picture

wrong post I can't delete, sorry.

damienmckenna’s picture

StatusFileSize
new15.79 KB

#122 rerolled.

sir_squall’s picture

I just tested it again on drupal 10.1.8-dev and it's not working anymore, do you know when this will be included in core?

sir_squall’s picture

did someone have a patch working for 10.2 at least?

redbrickone’s picture

I'm also curious about the status of getting this in Drupal 10. Any chance to get a patch rolled to 10.2.2?
EDIT: Actually, the 11 patch shared in #132 seemed to apply just fine on 10.2.

4kant’s picture

#132 applies cleanly on drupal 10.2.2.

CKeditor didn´t show up until I turned on "Always show the summary field" in content type´s form display for the body field.

Is that intended?

4kant’s picture

Supplement to my comment #136:
I just realized that for new nodes CKeditor shows up without the checkmark as mentioned above.
But for existing nodes I have to do that.

Edit: It looks like it doesn't work the same for all content types for me. What I had reported so far (that I had to check the box) applied to website. For all other content types (all self-created), the CKeditor also appears without any further steps).

rahaf albawab’s picture

StatusFileSize
new16.15 KB

I applied patch #132 to Drupal 10.2, but nothing changed because in the editor.libraries.yml file, drupal.editor has the version set as VERSION. Therefore, I rerolled the patch and removed it. If this is incorrect, please don't hesitate to provide the correct solution.

vasike’s picture

Status: Needs work » Needs review

made the MR green "again" after some updates from 11.x
A lot of errors on tests ... Needs review, for now ... so maybe there could code improvements - code review.

Wondering if we still need the "Needs tests" tag ...

smustgrave’s picture

Issue tags: +Needs usability review

Tagging for usability.

My only concern is this feels odd. You essentially have two full text fields now so why not add 2 fields.

But will leave for usability

smustgrave’s picture

Also going to tag for framework thoughts.

First of all thanks to everyone for the work!

But notes I'm seeing

Will need a configuration on the field for this feature, should not be the default added.
Will need to be able to limit the formatters, separate from the feature that was already added to filter formats from the main field. I imagine people won't want Full HTML to be used in their summary.
Will need a formatter configuration that will filter the summary now as the "Summary or trimmed" formatter don't believe is any longer safe.

Personally I'm wondering if this belongs in a contrib module vs core.

As sub maintainer I'm kinda -1 but this issue pre-dates me putting that hat on so will defer to the framework managers.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new90 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

IbrahimTameme’s picture

StatusFileSize
new16.73 KB

I applied #138 patch and it worked but there was an issue with unrecognized setAttribute function inside an event handler that casued an error and max length not working, setAttribute is a method that only works on individual DOM elements, not on jQuery objects or collections of elements.

To fix this, I modified the event handler to iterate over each element in field using .each(), allowing us to correctly call setAttribute on each raw DOM element individually.

banoodle’s picture

I'm truly grateful for the efforts here, but ideally, I would like to be able to have this option on any full-text field - not just "body."

The 10.2 patch (132) works well for Body fields. Is the ultimate D11 fix also just going to target the body field?

junaidpv’s picture

It now just works for body fields??

The original patch I posted in #23 were supposed to work with any long text field with summary. But I see it now evolved lot more but restricted to just body fields as there are some hard coding for body fields. Definitely it needs to be a generic one.

vasike’s picture

Status: Needs work » Needs review

Updated the MR - fix tests. made it green

I think this was in "Needs Review"

About the latest comments ... it's NOT only about the body field.... it's a generic solution for all text with summary fields.
Maybe the confusion is from tests ... that uses the already existing body field.

smustgrave’s picture

Believe this should be postponed on #3427095: [Meta] Deprecate text_with_summary

vasike’s picture

benjifisher’s picture

Status: Needs review » Needs work
Issue tags: -Needs usability review

@smustgrave:

When you tag an issue for usability review, please make it easy for the usability team to review the issue. Update the issue summary:

  • The "Proposed resolution" section should describe all the changes made in the issue.
  • The "User interface changes" should show the existing UI and the proposed UI.
  • The "Remaining tasks" should include one explaining the usability issue(s).

Most of the time, I prefer to have plain text in the "Proposed resolution" section and screenshots in the "User interface changes" section. For this issue, (1) needs work (already noted in the "Remaining tasks"), (2) is already in good shape, and (3) is missing.

You can also attend the weekly usability meeting to present an issue.

I am setting the status to NW.

Usability review

We discussed this issue at #3449637: Drupal Usability Meeting 2024-05-31. That issue will have a link to a recording of the meeting.

For the record, the attendees at the usability meeting were @benjifisher, @rkoller, @simohell, @shaal, and @SKAUGHT.

If you want more feedback from the usability team, a good way to reach out is in the #ux channel in Slack.

The only usability issue we see in the comments is from Comment #140:

My only concern is this feels odd. You essentially have two full text fields now so why not add 2 fields.

As far as we can tell, that is out of scope for this issue. It is certainly relevant for #3427095: [Meta] Deprecate text_with_summary, but in the context of this issue, we have two text fields and they both use the same text format. It makes sense to use CKEditor for both of them.

We also discussed whether it was worth the effort to discuss this issue, considering #3427095. We decided it is worth our time: if the text_with_summary is deprecated in Drupal 11 and removed in Drupal 12, that means it will still be around for several years.

We only tested the updated code on the Body field during the meeting, and I just noticed Comments #144, #145. Personally, I agree: if we are going to make this change, then it should apply to all text_with_summary fields, not just the body field.

steveoriol’s picture

Patchs does not works for D10.3.3...

junaidpv’s picture

StatusFileSize
new16.73 KB

Re-rolled for 10.3.3. Did not include change from #138 as not sure whether that is required. Need to test to see if it works.

junaidpv’s picture

I just verified that the patch in #151 works fine in 10.3.3

steveoriol’s picture

#151 works fine on D10.3.3 for me too, thanks

damienmckenna’s picture

fwiw #151 works against 10.3.5, thank you.

motame’s picture

#151 applied on 10.3.2. It works : the summary is shown in CKEditor but 1 file does not exist in 10.3.2 (core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5MarkupTest.php) and 2 changes are rejected (core/modules/editor/src/Element.php)

$ ls -l core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5^C
$ patch -p1 < core/modules/editor/js/2671162-151.patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5MarkupTest.php b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5MarkupTest.php
|index bd58595b12..b1a80fc7fd 100644
|--- a/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5MarkupTest.php
|+++ b/core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5MarkupTest.php
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored
patching file core/modules/ckeditor5/tests/src/FunctionalJavascript/CKEditor5Test.php
Hunk #1 succeeded at 157 (offset 75 lines).
Hunk #2 succeeded at 319 (offset 75 lines).
Hunk #3 succeeded at 563 (offset 75 lines).
patching file core/modules/ckeditor5/tests/src/Traits/CKEditor5TestTrait.php
patching file core/modules/editor/js/editor.js
patching file core/modules/editor/src/Element.php
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n] y
Hunk #1 FAILED at 67.
Hunk #2 FAILED at 77.
2 out of 2 hunks FAILED -- saving rejects to file core/modules/editor/src/Element.php.rej
patching file core/modules/editor/tests/src/Functional/EditorLoadingTest.php
Hunk #1 succeeded at 182 (offset 2 lines).
Hunk #2 succeeded at 223 (offset 2 lines).
$
jeroen dost’s picture

#151 does not apply on 11.2.3. What is the plan for Drupal 11?

zeeshan_khan’s picture

StatusFileSize
new7.98 KB

Adding patch for Drupal 11.1.2 but couldn't add tests code due to shortage of time.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.

foxy-vikvik’s picture

StatusFileSize
new16.75 KB

Problem/Motivation

On Drupal 10.6.2, in `CKEditor5TestTrait`
(https://git.drupalcode.org/project/drupal/-/blob/10.6.x/core/modules/cke...)),

The `getData()` method accepts a parameter, but changes passed to it are not applied correctly. I have updated the patch to fix this behavior.

gblicharz’s picture

I just verified that the patch in #159 works fine in 10.6.2. However there does still appear to be an issue when "Always show the summary field" is selected in the form display options for the Body field. In that case, the summary still does not have the CKEditor enabled.

jrglasgow’s picture

here is an updated patch that is working for 11.3.x - re-rolled from the patch in #157

hoemmawelt’s picture

#161 works fine on D11.3.6, thanks!

smustgrave’s picture

Status: Needs work » Postponed (maintainer needs more info)

Does someone want to turn this into a contrib module?

I doubt it'll ever land in core as the consensus from the core members I've talked to is if you get this scenario it would be better to just have 2 separate fields.