The image browser doesn't retain the "rtn" query parameter when generating new pages after form submission. This causes the 'insert' button to break because the form_id_name in fillImageForm is now empty.

The attached patch carries the "rtn" query parameter forward in all generated forms.

CommentFileSizeAuthor
whizzywyg.module-imagebrowser.patch4.14 KBPeter Bex

Comments

drupalnesia’s picture

Status: Active » Patch (to be ported)

Thanks for patching, I will review and put on next release soon.

drupalnesia’s picture

I try to re-produce this bug but fail, here are the details:
1. Create new page, insert Image and Save ... success
2. Create another new page, insert Image and Save ... success

Can you explain how to re-produce this bug?

Peter Bex’s picture

It only occurs when you click on a button which refreshes the page and try to insert an image afterwards.

Examples:

Open image browser, click "delete" for an image, click "insert" for another image - failure

Open image browser, change directory, insert image - failure

drupalnesia’s picture

Thanks for sample, now I can re-produce and confirm this is a bug in this module. Patching will be available soon.

drupalnesia’s picture

Fixed.

6.x-1.0-BETA4: Bug fix: can not insert image after upload/resize/delete image

drupalnesia’s picture

6.x-1.0-BETA5: A bug of "can not insert image after upload/resize/delete image" fixed on default folder but still occurs when user change to subfolder.

Any patches are welcome.

Peter Bex’s picture

I downloaded BETA5 to test it out but immediately I noticed that my patch wasn't applied in full.

The first hunk of the patch (The line

$output .= "<form action='".url("whizzywig/image_browse", array('query' => array('rtn' => $_GET['rtn'])))."' name='folder_nav' id='folder_nav' method='post' style='margin-bottom:2px;'>";

) doesn't appear to be applied to what's in BETA5.

I'm pretty sure that's why directory changes discard the 'rtn' query argument. Note the second argument to the url() function, it's missing in BETA5.

drupalnesia’s picture

I have added the missing patch but now all Insert button not work, I guess this caused by the new library of Whizzywig (v59 version). I will do a recheck.

Update: confirm, the bug caused by v59 of Whizzywig library. In the next version I will include old and new version, so we will have whizzywig057.js dan whizzywig059.js. This make easier to switch between each version.

drupalnesia’s picture

6.x-1.0-BETA6:
--------------
New: include simple.css
New: you can choose which library version will be used
Bug fix: can not insert image when change to subfolder
Bug fix: can not insert image, caused by whizzywig v59, we back to whizzywig v58
--------------
Until we fix the Insert Image button we still use Whizzywig v58.

Peter Bex’s picture

Alternatively, try my patch for wizzywig. The author John Goodman said it didn't help, but I needed to do it in order to get it working.

drupalnesia’s picture

Status: Patch (to be ported) » Closed (fixed)

Library v59 changes the way of Image Browser work. I still use v58 for 6.x-1.x so we can release a stable version. We will use v59 (or any new version) for 6.x-2.x version.

I close this ticket since its was solved.

Thanks for review, testing and patching. And lets go to 6.x-2.x version!

espirates’s picture

Has this been fixed yet ? The latest version still has the bug.

BrianLewisDesign’s picture

Input Format: Full HTML