Download & Extend

[D6] CKeditor is not working in Views header and footer text areas

Project:CKEditor - WYSIWYG HTML editor
Version:6.x-1.11
Component:User interface
Category:bug report
Priority:normal
Assigned:michal_cksource
Status:needs review

Issue Summary

Hi all,

I don't know if this is a common problem or not, but CKeditor doesn't seem to appear in header and footer areas. The only I see is a plain text areabox. Even If try to include the textarea location in the CKeditor config. I still doesn't seem to work. In all other places CKeditor works like a charm :-)

I'm using currently Drupal 6.22 - CKeditor 6.x-1.6 / the inputformat for the header is set to "Full HTML"

Any suggestions anyone.
Kind Regards
Benny

Comments

#1

Assigned to:Anonymous» michal_cksource
Status:active» needs review

Please check attached patch. Remember that on default installation in CKEditor "Global Profile" in "Visibility settings" tab there is something like "admin/build/views*" in exclude list. Please check patch with mentioned entry and without it. Of course when this entry is there, CKEditor should not be in Views textarea.

AttachmentSize
0001-1288664-CKeditor-is-not-working-in-Views-header-and-.patch 9.56 KB

#2

I added second patch.

AttachmentSize
0002-1288664-CKeditor-is-not-working-in-Views-header-and-.patch 2.18 KB

#3

I commit changes to git. Please check latest DEV version.

#4

Hello Michal,

Thanks for this ... I checked the exclude list and can't find any /views entries in the list.
Below a list of all the entries that are in the exclude list.

admin/user/settings.edit-user-mail-*
*.edit-pages
*.edit-pathauto-ignore-words
*.edit-recipients
*.edit-reply
*.edit-description
*.edit-synonyms
*.edit-img-assist-textareas
*.edit-img-assist-paths
*.edit-nodewords-description
*.edit-nodewords-description-value
admin/content/nodewords/global*
*.edit-relatedlinks-fieldset-relatedlinks
*.edit-allowed-values-php
*.edit-allowed-values
*.edit-update-notify-emails
*.edit-googleanalytics-*
*.edit-piwik-*
*.edit-feedburner-useragents
*@*.edit-webform-*
webform@*.edit-extra-items
admin/*/logintoboggan
admin/settings/actions/configure/*
*.edit-target
*.edit-wysiwyg-filter-*

I will try the patch and let you know A.S.A.P.

PS. Just one question - should I install both patches (on top of each other) ?

Kind Regards,
Benny

#5

Please test install latest DEV version as described here: http://drupal.org/node/1288664#comment-5053656
This DEV contains patches.

#6

Status:needs review» needs work

That has not solved the problem.

1) Go to views

2) Create a view

3) Add a Global Text to the view (Header, Footer, Empty, either one)

4) Enter some text (usually we don't get the editor when inserting)

5) Click Update to save the Global Text changes

6) Click on the Global Text entry

7) CKEditor appears this time

8) Add to the text or something

9) Click on Update

10) Come back: notice that the text is empty, gone, wiped out

11) Enter the corresponding path in the CKEditor

*/header/text.edit-options-content*
*/footer/text.edit-options-content*
*/empty/text.edit-options-content*

so the editor doesn't appear since it creates problems, removing it is a good solution, right?

12) Come back to the view, edit the Global Text you added

13) The CKEditor appears (eventually you need to test twice)

Note that I would prefer if it were to work, but either way, both capabilities should work, or at least not get the editor until getting the editor works when clicking Update.

Okay, for now I commented out the patching in ckeditor_init() since it doesn't work at all for me.

<?php
function ckeditor_init() {
 
drupal_add_css(drupal_get_path('module', 'ckeditor') .'/ckeditor.css');

 
// Added for support [#1288664] Views
  //if (module_exists('views') && preg_match('/admin\/build\/views/', $_GET['q']))
  //{
  //  $module_drupal_path = drupal_get_path('module', 'ckeditor');
  //  $editor_local_path  = ckeditor_path(TRUE);
  //  drupal_add_js($editor_local_path . '/ckeditor.js?I', 'module', 'footer', FALSE, TRUE, FALSE);
  //  drupal_add_js($module_drupal_path .'/includes/ckeditor.utils.js', 'module', 'footer' );
  //  drupal_add_js(array('ckeditor' => array('settings' =>array('edit-footer','edit-header'))), 'setting');
  //}
}
?>

Thank you.
Alexis Wilke

#7

Title:CKeditor is not working in Views header and footer text areas» [D6] CKeditor is not working in Views header and footer text areas

Changing title as usual

#8

I commited changes to GIT.
@AlexisWilke changes in ckeditor_init function are not all changes to this ticket. Another are in ckeditor.utils.js file.

#9

michal,

Speaking of that, why the ?I in

'/ckeditor.js?I'

Usually, Core adds that for you!

Thank you.
Alexis

P.S. I'll be testing all those changes at a later time and report accordingly.

#10

Drupal add this to css and js files. This is normal in drupal. This is related with cache I think.

#11

michal,

We agree, so why it is in the source of ckeditor?

Thank you.
Alexis

#12

I commited fix to GIT. Thanks for notice this.

#13

Status:needs work» fixed

Ok i make some changes and now everything seems to work.
I commit all changes to GIT.

If u found any more bugs, pls create new issue and report it there.

Greetings

#14

Status:fixed» closed (fixed)

#15

Version:6.x-1.6» 6.x-1.8
Status:closed (fixed)» active

I have tried this and this is not working for me at all. I am not sure what to do anymore. I am trying to do this with a Views Header and excluding this too didn't work either.

#16

Status:active» closed (fixed)

@ShawnRisk please don't reopen closed tickets especially when there is such request like:
http://drupal.org/node/1288664#comment-5168928

#17

Priority:normal» critical
Status:closed (fixed)» active

Hi.

This is not working for me either, I am using CKEditor 1.8 and the latest version of Views. The full ckeditor is displayed in the Views Empty Text Global Text Area and will not save any text written. I have tried adding the exclude paths in their raw form and using wildcards, but none work.

I have included a screenshot showing the editor displayed in these text areas.

AttachmentSize
CkEditor.JPG 40.84 KB

#18

Priority:critical» normal
Status:active» closed (fixed)

@moosh101
Please try use latest DEV version, it contains fixes to this issue.
Second don't reopen closed tickets (http://drupal.org/node/1288664#comment-5353120 & http://drupal.org/node/1288664#comment-5168928).

#19

Status:closed (fixed)» active

Not: I did not check whether it is working or not, but there is one thing that "looks wrong" and most probably is wrong.

"admin/ckeditor/get_settings'' is called by jQuery along with the following attributes:
{'id': imagefield_id, 'url': url, 'token': Drupal.settings.ckeditor.ajaxToken}

Now, when opening the ckeditor_get_settings() function in ckeditor.module, we can find code like:

<?php
if (empty($_POST['id'])
?>

<?php
echo  json_encode($_SESSION['cke_get_settings'][$_POST['id']]);
?>

so basically, $_POST['id'] is used, BUT, and here is my concern, in one line there is:
<?php
$profile
= ckeditor_user_get_profile($user, $_POST['#id']);
?>

$_POST['#id'] ???

#20

Hi michal_cksource,

Note that it is quite customary to reopen the same issue when it still doesn't work.

Actually, in most cases the author is expected to wait until the users say that it works for them instead of closing the issue before a "real fix" is found. 8-)

I now have tested the latest from earlier today and the editor works, but the content is still not saved. It is as if the CKeditor could not copy of the content of its textarea to the main textarea before the Views grab the content and their JS posts it to the server.

At this point I re-applied my "patch" as in #6 so I can still edit the header and footer of my views.

Thank you.
Alexis

#21

Still not working for me. I have installed latest Views & CKEditor dev release. The editor only save text to the view in plain text mode. It wont save or update text in full-html mode.

#22

Status:active» needs review

I make next patch for this bug...

Before attach this patch pls update to last DEV version - it's needed, because there was more bugs with ajax calls which are fixed now.
After do this include/exclude option should start to work. I also try to remove exclude from Views fields in "Global Profile" and for me everything start to work without problem.

So pls review this patch and write does it help or not.

Greetings

AttachmentSize
0001-1288664-by-dczepierga-CKeditor-is-not-working-in-Vie.patch 4.72 KB

#23

I installed the latest dev module and applied the patch and IT WORKS :) Thanks

#24

@AshleyBoardman, one more thing: Could you try to remove admin/build/views* from Global Profile exclude list and check does CKEditor work without problem for this fields?

Greetings

#25

I already had admin/build/views* removed from Global Profile exclude list. What I did find is that you have to change the input format to plain text and then insert the html code for it to work. Took a while to work out but I eventually got it.

#26

We found some cases in which this patch not help and CKEditor not work correctly.

I've attach new version of patch. Patch is created from last DEV version on GIT version, so if someone apply last patch pls rebase to last DEV version of GIT and use this patch.

Pls review this patch and write does it work or not.

Greetings

AttachmentSize
0002-by-dczepierga-CKeditor-is-not-working-in-Views-heade.patch 9.82 KB

#27

Version:6.x-1.8» 6.x-1.11

I tried today with 1.11 and it is still not working for me.

Have you tried with Views 3.x? Or just 2.x? I have 3.x only.

Thank you.
Alexis Wilke

#28

@AlexisWilke last fixes was for 2.x only.

#29

michal,

As I upgraded I looked at the code and could see changes to the handling of views but not enough, I guess, to fix the "real" problem. It's not too important to me to have that one as a WYSIWYG so no biggie.

My change in #6 still applies just fine to avoid such problems.

Thank you.
Alexis

nobody click here