Hi !

I installed Image Browser with the Wysiwyg plugin. I can insert an image in a node, save the node and display the node correctly (with the appropriate filter to convert ibimage tags by img HTML tag).

But, sometimes, depending on a combination of browser and proxy, the plugin cannot do its Ajax call correctly and replaces the ibimage tags with nothing, thus deleting the image on the node.

After some research, I found the culprit : the $.ajax call in ib_wysiwyg_init.js does not contain data though it uses a POST request. When the problem occurs, the Ajax calls receives a 411 error (Length required).

I've found the following post which explains the problem : http://groups.google.com/group/jquery-en/browse_thread/thread/22828981cf...

The patch simply transform the original call :

  $.ajax({
      type: "POST",
      url: Drupal.settings.basePath + 'index.php?q=imagebrowser/ajax&tag=[ibimage==' + tag + ']',
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      cache: true,
      async: false,
      success: function(data, textStatus) {
        ibdata = data;
      }
  });

into :

  $.ajax({
      type: "POST",
      url: Drupal.settings.basePath + 'index.php?q=imagebrowser/ajax&tag=[ibimage==' + tag + ']',
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      data: {},      /* ← force an empty data field */
      cache: true,
      async: false,
      success: function(data, textStatus) {
        ibdata = data;
      }
  });

One line is enough ! ;-)

I don’t think this could lead to side effects but you never know.

CommentFileSizeAuthor
patch.txt429 bytesAnonymous (not verified)

Comments

peter törnstrand’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.