Can't get images working - HTML is bizarre

joel_guesclin - March 2, 2007 - 11:45
Project:Htmlarea
Version:4.7.x-1.x-dev
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I've been using HTMLarea for a while, in 4.6. I'm now making some first installs for 4.7, and run into two problems:

1) The image upload doesn't work - I've enabled the "upload image" plugin, and the image button, the image module is also enabled. However, when I press on the "image" button, instead of opening a window with the expected htmlarea interface for uploading images (which works find in 4.6), it opens a window with the first list of "create content" choices displayed in my site window. It doesn't seem to be finding the correct popup file

2) When I press the "HTML code" button, it displays the code underneath the window instead of in the window (can't be changed or even seen properly).

I have tried both these using the same browser (Firefox 1.5) on the heydon demo site, and it seems to work fine.

I'm using the latest Xinha (beta 0.92)

Here is the relevant page code:

<script type="text/javascript">// <![CDATA[
  _editor_url = "/drupal-4.7.4/modules/htmlarea/xinha";
  _editor_lang = "en";
  _editor_skin = "";
//]]></script>
<script type="text/javascript" src="/drupal-4.7.4/modules/htmlarea/xinha/htmlarea.js"></script>
<script type="text/javascript" src="/drupal-4.7.4/modules/htmlarea/xinha/plugins/CharacterMap/character-map.js"></script>

<script type="text/javascript" src="/drupal-4.7.4/modules/htmlarea/xinha/plugins/ContextMenu/context-menu.js"></script>
<script type="text/javascript" src="/drupal-4.7.4/modules/htmlarea/xinha/plugins/FullPage/full-page.js"></script>
<script type="text/javascript" src="/drupal-4.7.4/modules/htmlarea/xinha/plugins/HorizontalRule/horizontal-rule.js"></script>
<script type="text/javascript" src="/drupal-4.7.4/modules/htmlarea/plugins/UploadImage/upload-image.js"></script>
<script type="text/javascript" src="/drupal-4.7.4/modules/htmlarea/plugins/UploadImage/lang/en.js"></script>
<script language="JavaScript" type="text/javascript"> // <![CDATA[
attacheditor = function(editor, name) {
  editor = new HTMLArea(name);
  editor.config.baseURL = "http://localhost/drupal-4.7.4";
  editor.config.baseHref = "http://localhost/drupal-4.7.4/";
  editor.config.sizeIncludesToolbar = false;
  editor.config.autofocus = false;
  editor.config.pageStyle = "body { background-color: #fff; font-family: arial,helvetica,sans-serif; }";
  editor.config.toolbar = [
    [ "fontname", "fontsize", "formatblock", "bold", "italic", "underline", "strikethrough", "separator", "subscript", "superscript", "separator", "removeformat", "killword" ],
    [ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator", "orderedlist", "unorderedlist", "outdent", "indent", "separator", "forecolor", "hilitecolor", "textindicator", "separator", "createlink", "insertimage", "inserttable", "inserthorizontalrule", "htmlmode", "popupeditor", "showhelp", "about" ]
  ];
  editor.config.killWordOnPaste = true;
  editor.registerPlugin('CharacterMap');
  editor.registerPlugin('ContextMenu');
  editor.registerPlugin('FullPage');
  editor.registerPlugin('HorizontalRule');
  editor.registerPlugin('UploadImage', 'modules/htmlarea/plugins/UploadImage/popups/insert_image.php');

  editor.generate();
};
var edit_body = null;
var edit_teaser = null;
var edit_code = null;
start_editor = function() {
  attacheditor(edit_body, 'edit-body');
  attacheditor(edit_teaser, 'edit-teaser');
  attacheditor(edit_code, 'edit-code');
};
addLoadEvent(start_editor);
//]]></script>

#1

Bluetiereign - March 5, 2007 - 09:03

Having the same problem. Also opens to add content when trying to insert a link.

#2

Bluetiereign - March 5, 2007 - 09:17

Read elsewhere that Gordon is dropping the upload image plugin support for image_assist. Disabled the plugin, left the option in in my htmlarea toolbar - and both the the image upload and link insert started working.

#3

joel_guesclin - March 6, 2007 - 13:16

Well I tried just disabling the plugin and the "input image" seemed to start working, but with one BIG exception: it does not show the existing images for you to choose one, nor does it allow you to upload a new image. For the moment, Tinymce remains the only solution.

#4

maikel - March 27, 2007 - 08:13
Status:active» needs review

change case 'uploadimage': to this in htmlarea.module

case 'uploadimage':
global $base_url;
// absolute path to make it work with IE
$popup = $base_url .'/'. drupal_get_path('module', 'htmlarea') .'/plugins/UploadImage/popups/insert_image.php';
$output[] = " editor.registerPlugin('$plugin', '$popup');";
break;

 
 

Drupal is a registered trademark of Dries Buytaert.