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.
It's not possible to alter information created in hook_editor.
This could be very handy for several things, where you only want to alter a part but let WYSIWYG or another module handle the bulk for the work.
Comment | File | Size | Author |
---|---|---|---|
#6 | hook_editor_alter-2415623-6.patch | 946 bytes | jansete |
#4 | hook_editor_alter-2415623-3.patch | 930 bytes | jansete |
#2 | hook_editor_alter-2415623-2.patch | 940 bytes | googletorp |
Comments
Comment #1
googletorp CreditAttribution: googletorp commentedI've added a small patch for this.
Comment #2
googletorp CreditAttribution: googletorp commentedComment #3
TwoDJust out of curiosity, do you have an example of needing this hook?
My worry is that if the hook is added, another module will use it to try to support other versions/variants of some editor before that support is in Wysiwyg itself. Then once Wyswyg does support that version/variant it won't be in a way that is compatible with what the other module does, so the resulting behavior will be unpredictable.
Comment #4
jansete CreditAttribution: jansete commentedIn some cases, you need to change urls for use CDN trought file_create_url.
We use ckeditor and for maximum performance our server admins don't allow static files with common urls, only works through CDN, this hookis very usefull for me.
I moved drupal_alter to the end, because some callbacks and config are defined after current drupal_alter position.
Comment #5
kristofferwiklund CreditAttribution: kristofferwiklund at Websystem commentedLooking at the patch. The hook needs to be prefixed with wysiwyg module name. As it is now it conflicts with the Editor module (https://www.drupal.org/project/editor)
It should be named as hook_wysiwyg_editor_alter.
Otherwise we should enable hooks if it is needed. And if module update breaks custom alter hook it is up to the site administrator to handle it.
Comment #6
jansete CreditAttribution: jansete commentedName changed!
Comment #8
TwoDThanks for helping with this!
I meant to set googletorp as the author as he made the original patch, but messed it up, sorry about that. Wish I could set more than one...
Comment #9
TwoD