Drupal 5.14
1. CCK 1.10
2. imagefield 2.2
3. 777 for both tmp and files directory.
4. download method public
5. imagefield configuration = Required, not multiple, filesize limit 8000

The field was working fine when I had the site in a /drupal sub directory. No problems at all. Then I moved the site to the domain's root directory, and suddenly I get a javascript error when trying to upload an image.

<br> <b>Fatal error</b>: Cannot access empty property in <b>/home/content/userdirectory/html/sites/all/modules/imagefield/imagefield.module</b> on line <b>1142</b><br>

After I try the upload, on the next page load I receive this error.

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM content_ WHERE vid = 0 LIMIT 0, 1' at line 1 query: SELECT FROM content_ WHERE vid = 0 LIMIT 0, 1 in /home/content/userdirectory/includes/database.mysql.inc on line 174.

I have found a few other module issues where users have experienced similar problems, but neither helped me solve the problem.
http://drupal.org/node/270174 - Related subforms
http://drupal.org/node/180023 - Filefield

And even though I'm getting these errors, the image uploads and displays just fine, but I have no idea how moving the site to a new directory caused the problem.
Besides moving the drupal base, I made no other changes.

Comments

simplekid’s picture

Getting this same problem here too! subscribing

jerry’s picture

Likewise; subscribing.

d.sibaud’s picture

same problem, please help

d.sibaud’s picture

Priority: Normal » Critical

it prevent my users from finish compiling nodes, arrrrgh!!!

cangeceiro’s picture

I am also experiencing this issue on 2.4 with cck 1.10

quicksketch’s picture

Status: Active » Postponed (maintainer needs more info)

Could anyone confirm if this is still a problem in the 2.6 version? The reports seemed to have stopped coming in (oddly around the time the 2.3 version came out) and I'm not sure if this was fixed in subsequent versions or not.

quicksketch’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

Closing after a month with no response. Please reopen if this problem exists in the Drupal 5 version.

zanoman’s picture

Drupal 5.19
Content Construction Kit (CCK) 5.x-1.10
ImageField 5.x-2.6

Problem is still present. Subscribing.

I can't imagine that nobody fixed it or everybody lives with it since February, it's so critical!

zanoman’s picture

Ok, I think I isolated the bug.

This has to do with ONE .htaccess rule that comes with Drupal:
#RewriteCond %{HTTP_HOST} ^domainname\.com$ [NC]
#RewriteRule ^(.*)$ http://www.domainname.com/$1 [L,R=301]

When active, upload is broken for me.
I have a virtual server pointing to a sub directory.
This rule works as it should, but then upload in general (file attachment AND image upload) is broken.

You need to LOGOUT and re-login your user(s) after you made changes to htaccess file ... if not upload progress bar spins forever (file is sent (I see network traffic) but not written on the server in /tmp).

I have no idea how to please both this rule and upload.

Oh, and no need to have 777 for /tmp and files/, 755 is enough (your Apache user writes the files on the disk, not you directly).

zanoman’s picture

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

Same thing happened to me after migrating a site. All was okay, upload was broken. The .HTACCESS suggestion here hinted that something about the domain settings were still wrong, and it was. Checking settings.php, $base_url was set wrong. Changing that fixed it all.

Just thought I'd share this frustrating little experience.

zanoman’s picture

I'm not sure I can fix it on my own.
Would you please add your changes about $base_url in settings.php?
Or best if you can provide a patch.
Thanks

quicksketch’s picture

Category: bug » support
Priority: Critical » Normal
Status: Needs review » Fixed

Marking this request as fixed. Sounds like a combination of $base_url and .htaccess redirects that causes this problem, rather than something specifically wrong with ImageField's implementation.

Status: Fixed » Closed (fixed)

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