Attempting to use token insert with CKEditor.
Userrole: Admin
All token insert submodules activated
Using wysiwyg 7.x-2.1
JQuery Update 7.x-2.2
Having enabled the token insert button from "Buttons and plugins" menu the insert token button appears. Clicking the button from a nodecreation form however produces an empty list.
Tested with and without the "Token insert pr. role" enabled.
Tested having some globally available tokens selected and without selecting any (meaning all tokens available)
If enabling the token insert module and Token filter the list of enabled tokens does correctly appear below the textarea, the wysiwyg list however ramains empty.
Several modules are described as being dependencies:
JQuery UI as well as Jquery UI Dialog however does not have a D7 release. Is that the actual issue or are these dependencies for D6 only?
| Comment | File | Size | Author |
|---|---|---|---|
| #13 | token_insert-wysiwyg-js-1314366-5232356.patch | 891 bytes | sachand |
Comments
Comment #1
attiks commentedComment #2
jelle_sI cannot seem to reproduce this. JQuery UI and JQuery UI Dialog are no longer dependencies. But with both 7.x-2.0 and the latest dev version the list is filled. Do you have any javascript errors? And could you try the latest dev version? (But as I said, I can't seem to reproduce with 2.0 either)
Comment #3
kevinquillen commentedThis doesn't work for me either, Drupal 6 version. Enable required modules and dependencies, add a few tokens, token insert dialog pops up and is blank with countless JS errors in firebug. Also cannot close modal window. Drupal 6.22.
Comment #4
jelle_sI'm sorry but I still can not seem to reproduce this (in 6.x or 7.x) and I've tried about everything by now... Can you give me exact instructions on how to reproduce? Obviously something must be wrong if 2 people have this bug...
Comment #5
martinyde commentedI have yet to be able to reproduce this myself, but i am experiencing this on two different d7 sites now. A third site however works like a charm. Having tried a number of different things this is what i have come up with thus far:
Changing themes seems to have some effect.
Using a theme like Sky 1.6(a newer version is available - havent tested) causes the error when it is the default theme. Even if the form field using token_insert is displayed in Bartik or Garland 7.8 (using administration themes).
If it's the other way around displaying in Sky but using a core theme as default doesn't seem to cause this error. So the error seems to be linked to your choice of default theme if you use a different theme to edit the field. (my custom themes are placed in sites/all/themes)
Changing themes on my d7.7 site doesn't seem to have any effect. Using Omega theme 3.0-beta2 causes the error. And switching to other themes for instance Bartik as both default and adm. theme still causes the error.
I have yet to be able to reproduce the error using only core themes and D7.8 I hope to have time to test this tomorrow.
Need further info please let me know.
/Martin
Comment #6
kevinquillen commentedI am using the Rubik/Tao theme for the admin/node creation screens as well as the Admin toolbar it comes with, if that helps.
Beyond that its just the standard modules. WYSIWYG, CKEditor, Views, etc.
The types of errors I was getting in Firebug seemed to be a packing and/or file missing type of error (ex. 'e is undefined' 'Event is undefined')
Comment #7
jelle_sThat actually did make a lot of sence (with the default theme etc.). The form you see in the dialog div is rendered by php (form api). This means we do an ajax call to get the form. This form is rendered in the default theme and we made sure we didn't retreive the entire page, but just the form (with jQuery selectors). So our jQuery selector was '.content #token-insert-wysiwyg-form'. But appearantly the '.content' div isn't obligatory for themes, and that's why with Sky nothing was returned. I replaced the jQuery selector with '#token-insert-wysiwyg-form' (removing the '.content'). This should fix your problem.
But this still does not explain the behaviour for 6.x, because in Drupal6, when you create a menu item with 'drupal_get_form' as page callback, what you get is just the form (not even rendered in a page with sidebars etc.). This means we just retreive the entire 'page' without jQuery selectors. So that could not be the problem.
I created a setup as you described but I still can not reproduce this,
is there a way you could give me access to a form on your website so I could test this?
Or could you go to '/token_insert_wysiwyg/insert/1' on your site and see if you can see the form?
Comment #8
martinyde commented#7 confirmed to solve the issue for d7. Good job, great response time, awesome module!
/Martin
Comment #9
attiks commentedwaiting for feedback of Kevin Quillen on D6 problem
Comment #10
kevinquillen commentedDon't wait on me- I had to move to Token Filter to get it done (on live site).
I will have to try again when I get a chance.
Comment #11
attiks commentedMarking this as fixed, open a new issue if you still have the problem.
Comment #13
sachandI faced same issue and when investigated , i found that its an issue of url encoding . the url - "index.php%3Fq%3Dtoken_insert_wysiwyg/insert/form-
" gives 404 error resulting in empty token list. I have fixed this by changing this url by url in clean format (token_insert_wysiwyg/insert/form-
) in token_insert_wysiwyg.js file . Patch file is attached with this comment. I have tested it on my local machine with both cases : clean url enabled and clean url disabled. its working fine. please review it.
Comment #14
sachandComment #15
sachandPlease review patch uploaded.
Comment #16
jelle_sCommitted to the latest dev. Thanks for the patch!