1

Yet another question regarding JS resources load outside of civicrm. We load contact edit form via CRM.popup from a page outside of /civicrm/ path (from custom dashboard page created in drupal). So far [it was] so good; recently we've mentioned that javascript goodies have stopped working on the form; only related message in a browser console is CKEDITOR is undefined. It all goes back to normal after disabling WYSIWYG at "Display Preferences" (we've got same error with TinyMCE enabled). Is it something we could "cure" via configuration tinkering or it is something to report as an error?

  • What version of CiviCRM? wysiwyg loading is handled quite differently from 4.6 - 4.7. – Coleman May 25 '16 at 15:05
  • Thanks for getting back to me @Coleman. It's 4.6.16; we aren't brave enough to step into 4.7.x yet. – yurg May 25 '16 at 15:55
1

Since you are using 4.6, the answer is that you need to ensure templates/CRM/common/wysiwyg.tpl is being loaded and that the smarty variable $includeWysiwygEditor is set to true.

Or since you are hacking around CiviCRM anyway, just keep it simple and stick something like this in your page source:

<script type="text/javascript" src="/path/to/civicrm/packages/ckeditor/ckeditor.js"></script>
  • Thank you @Coleman, that simple ckeditor.js include works like a charm! For those who'd be surprised drupal_get_path('module', "civicrm") returns "civircrm/drupal" instead of just "civicrm", there is a simple trick "proudly found elsewhere at stackexchange": $civipath = substr(drupal_get_path('module', 'civicrm'), 0, strripos(drupal_get_path('module', 'civicrm'), '/')); – yurg May 26 '16 at 10:52
  • The /../ trick usually works too. – Coleman May 30 '16 at 1:36
0

I experimented the same issue with 4.7.10

In the New Mail form I cannot see the ckEditor buttons but no javacript error are raised. If I instead go to [Configure CKEditor] page I get the following error:

ReferenceError: CKEDITOR is not defined in abstracttoolbarmodifier.js

  • Going forward with my test and comparing two installation (one working and the other no) it seems the problem is in the database. I mean that pointing one database the editor does not work, pointing instead another one with same source, it work properly. Does anyone have any idea? – marcello Apr 26 '17 at 15:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.