Needs review
Project:
Image FUpload
Version:
6.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
30 Jul 2009 at 19:53 UTC
Updated:
3 Dec 2011 at 15:00 UTC
Jump to comment: Most recent file
Comments
Comment #1
nightowl77 commentedHi Thomas
I had the same problem. I use nodereference_url for a photo gallery system (as described in Jeff Eatons video) but wanted to add the additional functionally of image_fupload, which isn't covered in Jeff's video.
To make this work I used the one image per node option. But the client got terribly confused when he returned to the "node add" page - since noderefernce_url could not pick up the reference any more - causing all sorts of havoc.
I've submitted a patch that solves this problem. The patch does the following:
- on your image_fupload widget (in your manage fields area) you can now tick a checkbox that says
" Redirect to destination sent by system/other modules "
- It will then redirect the user back to whatever the destination was. This is great because noderefernce_url has 3 options of it's own (also along the lines of - return to node created, return to referened node, etc, etc). The 2 modules, and possibly other modules, now play along nicely.
- The patch doesn't interfere with existing options - if you don't select that tickbox "if statements" will make sure everything works like it did before. Even if you select the tickbox and you had a "Redirect URL" configured, the original "redirect URL" will take preference.
Note: Not tested for these scenarios:
- I didn't test redirection on multiple-images-per-node galleries. Sorry guys - this project was supposed to be finished yesterday and had to start with the next one... well... yesterday. It is my hope that this patch will give a good starting point, most of the grunt work and figuring out is already done, someone must just add a line or 2 of code where the multiple-images-per-node executes
- I didn't test this where the user doesn't have access rights to "edit captions". When "edit captions" is off I get an error saying that there are "no images uploaded" when in fact there are images. At first I thought I broke something but checked out the HEAD from cvs and it still happens. Will investigate later and submit a bug report if the problem isn't purely on my side.
This patch was against the HEAD code as of 25 Nov 2009. Your feedback would be appreciated.
Comment #2
hadsie commentedThanks for that patch @nightowl77. One suggestion though, the code in image_fupload_imagefield.module might be a bit cleaner if you used drupal_get_destination() and the options parameter of url() like so:
Comment #3
sinuz commented@1, just tested your patch and it works really well! Thanks for that.
Maybe this patch can be combined with the #527618: custom redirection after multiple node creation using tokens patch?
Comment #4
grandcat commented@hadsie:
Would be great if you can create a new patch which includes all changes compared to CVS HEAD version.
Comment #5
hadsie commentedI've attached a patch against HEAD with the mentioned change.
Comment #6
webadpro commentedI'm just wondering if this feature has been added to the dev version because it doesn't seem to be in the 6.x-3.0-rc2 version.
Thanks
Comment #7
ankerek commented@5 It works! Thank you