WordPress.org

Make WordPress Core

Opened 14 years ago

Closed 14 years ago

#2612 closed defect (bug) (invalid)

Image drag and drop problem with Firefox and TinyMCE on WP 2.0

Reported by: guillep2k Owned by:
Milestone: Priority: low
Severity: minor Version: 2.0.2
Component: General Keywords: TinyMCE Firefox drag drop
Focuses: Cc:
PR Number:

Description

(As seen in forum thread http://wordpress.org/support/topic/66431)

I've got a WordPress 2.0 blog in a path like www.domain.com/blog (i.e., not at the website's document root but in a subdirectory). When I try to edit/create a post I can upload images alright, but when I try to drag and drop the image into the WYSIWYG editor, the picture is dropped without the '/blog/' part. For example, my pictures are uploaded (using the WP upload feature) into $DOCUMENT_ROOT/blog/wp-content/uploads/my_picture.jpg. When checked via FTP, the picture looks fine in the right directory. I can browse and list and preview all the pictures I upload. However, when I drag the picture and drop it into the editor, a "broken link" picture is inserted. If I check the picture's URL, it looks like www.domain.com/wp-content/etc. instead of www.domain.com/blog/wp-content/etc.
This only shows up with Firefox (latest version and a very old one too), but in Internet Explorer it works perfectly fine, i.e., the drag and drop function inserts the image with the correct path.
I checked up some stuff, and I could determine that the script inline-uploading.php is doing the things right (at least the generated content has the correct links). I could not determine where the /blog/ part of the path was lost, but I think it is somewhere into tiny_mce_gzip.php.
With "Send to Editor" it works fine in both navigators. Only the drag and drop function seems to fail with Firefox.

Change History (5)

#1 @guillep2k
14 years ago

This bug has been confirmed by forum user HandySolo, as he says so himself.

#2 @skeltoac
14 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Acknowledged. Browsers handle drag and drop so variably and it changes so unpredictably with each browser update that we aren't even calling it a feature and we're not going to try to keep up with it. That is why we have the Send To Editor link. Use what works.

You may submit your bug report to the TinyMCE project on SourceForge if you like. We incorporate their fixes fairly regularly.

#3 @martypauley
14 years ago

  • Resolution wontfix deleted
  • Status changed from closed to reopened

I'm not convinced that this is a TinyMCE problem.

I fixed it by removing the "document_base_url" line from tiny_mce_gzip.php:

--- tiny_mce_gzip.php.orig 2006-05-12 01:15:24.000000000 +0100
+++ tiny_mce_gzip.php 2006-05-12 01:15:28.000000000 +0100
@@ -157,7 +157,6 @@

convert_newlines_to_brs : false,
remove_linebreaks : true,
save_callback : "wp_save_callback",

  • document_base_url : "<?php echo trailingslashit(get_bloginfo('home')); ?>",

valid_elements : "<?php echo $valid_elements; ?>",

<?php do_action('mce_options'); ?>

plugins : "<?php echo $plugins; ?>"

#4 @martypauley
14 years ago

Sorry about the formatting in that last post. Here's the patch again:

--- tiny_mce_gzip.php.orig      2006-05-12 01:15:24.000000000 +0100
+++ tiny_mce_gzip.php   2006-05-12 01:15:28.000000000 +0100
@@ -157,7 +157,6 @@
        convert_newlines_to_brs : false,
        remove_linebreaks : true,
        save_callback : "wp_save_callback",
-       document_base_url : "<?php echo trailingslashit(get_bloginfo('home')); ?>",
        valid_elements : "<?php echo $valid_elements; ?>",
 <?php do_action('mce_options'); ?>
        plugins : "<?php echo $plugins; ?>"

#5 @skeltoac
14 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

That setting has a purpose. I don't remember the bug it handles but if you do some trac searches you'll probably find it. Try creating a link with a relative URL.

Besides, we're not supporting drag and drop. If it happens to work in your browser, that's fine. Some very popular browsers are incapable of proper drag and drop (ringmaster and I confirmed that insufficient data exists in the clipboard when dragging an image in IE 6) so we made menus and that's what we support.

You may use the mce_options action to drop in some javascript to modify the mce options if you like.

Note: See TracTickets for help on using tickets.