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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

googletorp’s picture

Status: Active » Needs review
FileSize
939 bytes

I've added a small patch for this.

googletorp’s picture

FileSize
940 bytes
TwoD’s picture

Just 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.

jansete’s picture

In 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.

kristofferwiklund’s picture

Status: Needs review » Needs work

Looking 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.

jansete’s picture

Status: Needs work » Needs review
FileSize
946 bytes

Name changed!

  • TwoD committed b38c99c on 6.x-2.x authored by jansete
    - #2415623 by googletorp, jansete: Added hook_wysiwyg_editor_alter().
    
  • TwoD committed 43f70d1 on 7.x-2.x authored by jansete
    - #2415623 by googletorp, jansete: Added hook_wysiwyg_editor_alter().
    
TwoD’s picture

Thanks 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...

TwoD’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.