Node Preview Errors, not generating appropriate URLS when rewrite engine off.

ingacosta - March 6, 2008 - 19:19
Project:ImageField
Version:5.x-2.0-rc6
Component:Code
Category:support request
Priority:normal
Assigned:Darren Oh
Status:closed
Description

1. cck 5.x - 1.6-1
2. imagefield 5.x-2.0-rc6
3. Complete permissions
4. download public files
5. imagefield witch default configuration

6. expected results:
I want to upload an image to the image_field and, inmediatly after upload or when click preview button, I want to view the image uploaded

7.Unexpected actual results:
I view an "image not found" icon, and I have a Page Not Found entry in Logs for each image.

I looked at the file folder and see that the image doesn't upload until I click submit button.

#1

ingacosta - March 6, 2008 - 19:25
Title:Firefox doesn't show imagefield images» Image doesn't upload in the right time
Component:User interface» Code
Category:support request» bug report

#2

ingacosta - March 7, 2008 - 13:36
Category:bug report» support request

#3

dopry - March 19, 2008 - 21:26
Status:active» postponed (maintainer needs more info)

The image will not be in the final destination on preview. There is a menu callback that handles displaying the image... I'll see if I can reproduce later. Do you have clean-urls enabled? they shouldn't be required, but something you can test.

.darrel.

#4

jpoesen - March 20, 2008 - 22:36

Check out an imageapi issue: http://drupal.org/node/236911#comment-777252.

Also check out these imagefield issues:
http://drupal.org/node/229965
http://drupal.org/node/230881
http://drupal.org/node/174075

Could these all be related?

#5

majorxp - March 23, 2008 - 18:42

I'm having the same issue. When you upload a picture it does not show on the resulting page, however it does show upon submit. I have drupal handling the images, not open http in file settings.

#6

Darren Oh - May 1, 2008 - 15:56
Status:postponed (maintainer needs more info)» needs review

Same problem as issue 130701 on the DRUPAL-5 branch. When the download method is public and the site does not support clean URLs, file_create_url() will return a path to a file that does not exist and the menu system will not be used. Here's a patch to test.

AttachmentSize
imagefield.module-230848.patch 1.09 KB

#7

dopry - May 11, 2008 - 22:47

I cannot reproduce with and with out clean urls.. using the DRUPAL-5--2.

#8

dopry - May 11, 2008 - 23:44
Status:needs review» closed

#9

Darren Oh - May 12, 2008 - 01:37
Status:closed» needs review

dopry, you can't reproduce this if your site supports URL re-writing. If you use Apache, try disabling mod_rewrite and restarting.

#10

dopry - May 12, 2008 - 18:46
Status:needs review» needs work

Doesn't work with private files, rewrite enabled and clean urls.

#11

dopry - May 12, 2008 - 18:57
Title:Image doesn't upload in the right time» Node Preview Errors, not generating appropriate URLS when rewrite engine off.

@DarrenOh,
This came up with imagecache I believe and we had to implement a custom file_create_url there. It may be the same here. We should generate a test case for this issue. I'd be happy to write the test, but what we really need to know is how the real and preview URLS should look in the following cases...

public files, clean urls on
public files, clean urls on
private files, clean urls off
private files, clean urls off

If you can create that set of URL's I'll write a test case we can work with to resolve this issue.

#12

Darren Oh - May 12, 2008 - 22:49
Assigned to:Anonymous» Darren Oh

I'll work on it.

#13

Darren Oh - May 13, 2008 - 15:07

Correct URLs:

public files, clean urls on
http://example.com/files/directory/image
public files, clean urls off
http://example.com/?q=files/directory/image
private files, clean urls on
http://example.com/system/files/directory/image
private files, clean urls off
http://example.com/?q=system/files/directory/image

The problem with the current code is that file_create_url() will always generate http://example.com/files/directory/image for public files. The solution is to place the menu path in $file['preview'] and use url() instead. Patch attached.

AttachmentSize
imagefield.module-230848-13.patch 3.23 KB

#14

Darren Oh - May 13, 2008 - 15:07
Status:needs work» needs review

#15

ingacosta - May 21, 2008 - 15:52

thank you very much for your help, I will test your patch.

Thanks again

#16

MGParisi - July 10, 2008 - 09:30

Where is the DEV for 2.1? It only lists DEV for 1.X

#17

pedrofaria - July 16, 2008 - 19:42

Good Job... work so fine for me!

#18

Darren Oh - August 29, 2008 - 16:02
Status:needs review» reviewed & tested by the community

Looks like pedrofaria forgot to change the status.

#19

quicksketch - March 13, 2009 - 01:12

Thanks Darren Oh. Committed to the 5.x branch.

#20

quicksketch - March 13, 2009 - 01:12
Status:reviewed & tested by the community» fixed

#21

System Message - March 27, 2009 - 01:20
Status:fixed» closed

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

 
 

Drupal is a registered trademark of Dries Buytaert.