Problems using Wysiwyg editors (including FCKeditor and TinyMCE)

jlmeredith - March 10, 2009 - 19:44
Project:Content administration
Version:6.x-1.0-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:needs review
Description

Great module! Wish it were ready for prime time! Not far away though!

When I go to create content, the interface does not render the FCK Editor nor does it give the option to switch in and out of plain text.

#1

alisonjo2786 - March 17, 2009 - 18:27

Ditto for me! Also... [I will submit my "also" in its own issue momentarily...]

#2

detour - March 31, 2009 - 00:04
Title:FCK Editor and Switch Mode for FCK does not appear» Problems using Wysiwyg editors (including FCKeditor and TinyMCE)
Component:User interface» Code
Status:active» needs work

Hi jlmeredith and Alison,

I can confirm that I'm also having problems using Wysiwyg editors (including TinyMCE, FCKeditor, and others) within the Content Administration interface.

I hope to support these editors in a future version of this module.

#3

lance.gliser - April 28, 2009 - 17:10

Sorry Detour, this one's bigger than I have time to tackle for the reward. However, I can offer a side solution.
If you must have an editor, but still wish to use this module, the follow code changes will simplify the module by removing the AJAX options for node creation, editing, and viewing. They will instead link to their normal system locations for each. Perhaps this should be part of the module at some point as a "simple version."

Please be aware. The author of this module does not endorse this alteration. Support will not be provided. Updating your module to the latest version will remove these changes! (And hopefully by then the editor problem will be solved and all will be well.)

In nodeadmin.module around line 300, insert the following line:
$results['nodeData'][$obj->nid]->path = drupal_get_path_alias('node/'.$obj->nid);

....
while ($obj = db_fetch_object($res)) {
      // if text search results exist, intersect with query results
      if (!is_array($text_results) || in_array($obj->nid, $text_results)) {
        $results['nodeData'][$obj->nid] = $obj;
$results['nodeData'][$obj->nid]->path = drupal_get_path_alias('node/'.$obj->nid);
...

Around line 109 update to:

      $links .= "<a href='/{$node->path}' title='". t('View') ."'><img src='". $base_url .'/'. drupal_get_path('module', 'nodeadmin') ."/icons/doc-option-tab.png' alt='". t('View') ."' width='16' height='16' /></a>";
      $links .= " <a href='/node/{$node->nid}/edit' title='". t('Edit') ."'><img src='". $base_url .'/'. drupal_get_path('module', 'nodeadmin') ."/icons/doc-option-edit.png' alt='". t('Edit') ."' width='16' height='16' /></a>";
      $links .= " <a href='/node/{$node->nid}/delete' title='". t('Delete') ."'><img src='". $base_url .'/'. drupal_get_path('module', 'nodeadmin') ."/icons/doc-option-remove.png' alt='". t('Delete') ."' width='16' height='16' /></a>";

Around line 93 comment out:

/*
$output .= '<br/><div class="nodeadmin-addnode"><img src="'. $base_url .'/'. drupal_get_path('module', 'nodeadmin') .'/icons/doc-option-add.png" width="16" height="16" /> Add new content by type: <select id="addType"><option value="" selected></option>';
  foreach ($ctypes as $ctype => $cdata) {
    $output .= '<option value="' . $ctype .'">'. $cdata->name .'</option>';
  }
  $output .= '</select></div>';
*/

In nodemodule.js update line 61 to:

      tableBody.append('<tr class="row ' + rowClass + '"><td class="node-actions">' + formatNodeButtons(<strong>nodeData[nid]</strong>, isOpen) + '</td><td id="node-' + nid + '">' + nodeData[nid].title + '</td><td class="node-field">' + typeData[nodeData[nid].type] + '</td><td class="node-field">' + nodeData[nid].name + '</td><td class="node-field">' + nodeData[nid].formattedDate + '</td></tr>');

On line 372 update function formatNodeButtons to:

  str = "<a href='/"+nodeData.path+"' title='View'><img src='" + Drupal.settings.nodeadmin.modulePath + "/icons/doc-option-tab.png' alt='View' width='16' height='16' /></a>" +
    " <a href='/node/"+nodeData.nid+"/edit' title='Edit'><img src='" + Drupal.settings.nodeadmin.modulePath + "/icons/doc-option-edit.png' alt='Edit' width='16' height='16' /></a>" +
    " <a href='javascript:deleteNode(" + nodeData.nid + ")' title='Delete'><img src='" + Drupal.settings.nodeadmin.modulePath + "/icons/doc-option-remove.png' alt='Delete' width='16' height='16' /></a>";
if (opened) {
    str += " <a href='javascript:hideNode(" + nodeData.nid + ")' title='Close'><img src='" + Drupal.settings.nodeadmin.modulePath + "/icons/arrow-end-up.png' alt='Close' width='10' height='10' /></a>";
  }
  return str;

#4

lance.gliser - April 28, 2009 - 17:12
Status:needs work» needs review

If you'd like to take a look, Detour. I know it's not your original direction. But I thought you might be interested in a work around until you get it fixed.

#5

tuffnatty - July 1, 2009 - 07:41

subscribing

#6

tuffnatty - July 8, 2009 - 08:06

To whom it may be interesting: after I added two lines:

<?php
  drupal_add_js
(drupal_get_path('module', 'wysiwyg') .'/wysiwyg.init.js');
 
drupal_add_js(drupal_get_path('module', 'wysiwyg') .'/wysiwyg.js');
?>

to nodeadmin_page() function, right before the first drupal_add_js() call in this function, Wysiwyg started working!

P.S.: I also had to add this line to editSubmit() in nodeadmin.js right after "if (op == 'Save') {" line:

form.find('.wysiwyg-processed').each(function() { Drupal.wysiwygDetach(form, Drupal.wysiwyg.getParams(this)); });

Otherwise it would not copy content from fckeditor to textarea on save action.

That's it, FCKeditor/Wysiwyg working fine here! Of course these are dirty hacks but they can point someone in the right direction.

#7

Danny_Joris - September 30, 2009 - 19:49

Subscribing.

Is this module still being maintained? It's been 22weeks ago since the last commit.

#8

tuffnatty - October 1, 2009 - 11:48

I'm afraid someone interested should take over the module maintenance or at least get CVS access. I don't know the traditional Drupaler rules for that, though.

#9

detour - October 2, 2009 - 17:21

This module is not unmaintained. However I haven't had time recently to tackle the larger issues that remain -- like compatibility with Wysiwyg editors, which also depends significantly on Drupal's JavaScript system as well as the Wysiwyg editors themselves.

If anyone is interested in contributing to this project, they should contact me, but they should also post patches in the issues queue. I'll try to review and commit the patches that have been submitted soon.

Thanks for everyone's interest in this module. I hope this module can serve as a drop-in improvement on the core content page until it becomes more feature-rich.

#10

Danny_Joris - October 5, 2009 - 14:11

Ok, thanks for your answer, detour.

No stress, take your time... :)

Cheers,
Danny

 
 

Drupal is a registered trademark of Dries Buytaert.