Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When editing a Views Global: Text area (Global: Text area), the text formats integrate with it, but the ckeditor module doesn't plug into the text area to provide, for example Full HTML, editing within the Global: Text area (Global: Text area) being used within the view, for example to create a (Full HTML) header or footer for a view.
Comment | File | Size | Author |
---|---|---|---|
#22 | 2900594-22.patch | 689 bytes | nessunluogo |
#4 | 2900594-4.patch | 693 bytes | Wim Leers |
Comments
Comment #3
Wim LeersReproduced.
Apparently this is being done intentionally though. See
\Drupal\views\Plugin\views\area\Text::buildOptionsForm()
:This already was the case in
a626abb
— the commit that added the 7.x-3.x Views branch to Drupal core.To answer why this was added in the first place, I cloned Views' 7.x-3.x branch and blamed it:
That showed me this:
There's no issue with related discussion to understand the reasoning.
However, I know that https://www.drupal.org/project/wysiwyg and the WYSIWYG editors at the time were less robust than CKEditor is today. So perhaps it's time to change this?
Comment #4
Wim LeersComment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedWhen we use a ckeditor button with a dialog (e.g. image), it closes the parent dialog. This can lead to confusion and loss of unfixed data in the text area. Without this flaw, the appearance of the ckeditor in the view looks perfect.
Comment #6
Wim Leers#5: d'oh, you're right! That's a long-standing bug in the Dialog system…
Can you find the right issue, and mark this postponed on that?
Comment #7
jibranI'm sure this issue is Duplicate of some issue.
Comment #8
jibranDuplicate of #2741187: Allow usage of WYSIWYG in views text area fields gmail search++
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedWe definitely have a few duplicate works with it:
Comment #10
Wim LeersWow, great research @jibran, and especially @vaplas! Adding them as related issues.
Comment #12
nightlife2008 CreditAttribution: nightlife2008 at Randstad Digital commentedHi,
Just wanted to ask a question about nested modals, and the fact that currently drupal always passes `#drupal-modal` as the default selector...
Say you’d have nested modals, because a link in the outer modal triggers a new modal (CKeditor in modal + a LinkIt modal for example).
Would it be logical if both modals would have a randomly chosen ID (`#drupal-modal-uniqid()`) and push it onto an array of modal ID’s, and upon closing a modal, it would just follow the logic of “popping” off the last modal ID of the stack as it would be unlogical of an inner modal to close the outer modal?
I’m only a bit worried about feedback that this would not be a structural solution, but more a guesswork-method
But again, the modal-principal should block any interaction with anything except the upper modal. Also, it should be an all-js solution (I think), as between AJAX responses, Drupal can’t keep up with the generated ID’s coming from pretty much any random caller, being core or contrib
Keeping it client-side can also guarantee name-collision on the ID’s, and we could still "fallback" to the provided selector if it's different from the default "drupal-modal" in case someone did specify it.
I’d kindly appreciate your 2-eurocents on this :-)
Comment #13
nightlife2008 CreditAttribution: nightlife2008 at Randstad Digital commentedLuckily the geniuses on Drupal Core have created prototype commands so with a bit of extra code, you could easily achieve the nested modals...
Place the above code in a JS file, and load it with your module's or theme's libraries.yml file.
Comment #14
flyke CreditAttribution: flyke commented@nightlife2008 This is very interesting.
Unfortunatly when I apply your code, the wysiwyg editor is missing from textareas that normally do show up in the normal modal.
My problem was that I have an edit field in a modal with ckeditor, but when clicking on the link button it would replace the entire field edit modal. I hoped this code of yours could fix this, but if it removes the ckeditor, it is pretty useless unfortunately.
Any help on how to enable ckeditor with your code ?
Comment #15
johnzzonI'm also having the issue with disappearing CKEditor after trying to add that javascript, @nightlife2008.
If anyone has some insight on what could be wrong, I'm all ears!
Comment #17
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI have linkit enabled
I select a url
i hit save
the modal does not close
I get the following:
js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn85lneSKc.js:2 jQuery.Deferred exception: Cannot read property 'getRanges' of null TypeError: Cannot read property 'getRanges' of null
at Object.saveCallback (https://site/core/modules/ckeditor/js/plugins/drupallink/plugin.js?t=pgr...)
at https://onebayview.com/sites/site/files/js/js_2Ap9rB8KBM6XuA60h9L-VbjT3J...
at dispatch (https://site/sites/site/files/js/js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn8...)
at q.handle (https://site/sites/site/files/js/js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn8...)
at Object.trigger (https://site/sites/site/files/js/js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn8...)
at https://site/sites/site/files/js/js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn8...
at Function.each (https://site/sites/site/files/js/js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn8...)
at r.fn.init.each (https://site/sites/site/files/js/js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn8...)
at r.fn.init.trigger (https://site/sites/site/files/js/js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn8...)
at Drupal.AjaxCommands.editorDialogSave (https://onebayview.com/sites/site/files/js/js_heyBfxySc9P2tJEGTJdrDhgu4m...) undefined
r.Deferred.exceptionHook @ js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn85lneSKc.js:2
k @ js_F4yJIbj7ENAGfZRTjH5aygX1rBPOJd_GpDn85lneSKc.js:2
Comment #18
Déjà vu CreditAttribution: Déjà vu as a volunteer commented#4 patch worked for me thank you.
Comment #22
nessunluogo CreditAttribution: nessunluogo commentedDrupal 9.3 could not apply patch #4. Providing new patch.
Comment #25
quietone CreditAttribution: quietone at PreviousNext commentedCKEditor has been removed from core, CKEditor 4 is removed from Drupal Core in 10.0.0
Comment #26
cilefen CreditAttribution: cilefen as a volunteer commentedThis is actually a Views issue. I’m not sure it should have been moved.