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.

Comments

ingacosta’s picture

Title: Firefox doesn't show imagefield images » Image doesn't upload in the right time
Component: User interface » Code
Category: support » bug
ingacosta’s picture

Category: bug » support
dopry’s picture

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.

jpoesen’s picture

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?

jgoldfeder’s picture

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.

darren oh’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new1.09 KB

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.

dopry’s picture

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

dopry’s picture

Status: Needs review » Closed (fixed)
darren oh’s picture

Status: Closed (fixed) » 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.

dopry’s picture

Status: Needs review » Needs work

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

dopry’s picture

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.

darren oh’s picture

Assigned: Unassigned » darren oh

I'll work on it.

darren oh’s picture

StatusFileSize
new3.23 KB

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.

darren oh’s picture

Status: Needs work » Needs review
ingacosta’s picture

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

Thanks again

MGParisi’s picture

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

pedrofaria’s picture

Good Job... work so fine for me!

darren oh’s picture

Status: Needs review » Reviewed & tested by the community

Looks like pedrofaria forgot to change the status.

quicksketch’s picture

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

quicksketch’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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