Whe I put more than one imegefield and I begin to upload more than one file at same time It gives me an error on SQL sintax. How can I block others uploads?.
Whe I put more than one imegefield and I begin to upload more than one file at same time It gives me an error on SQL sintax. How can I block others uploads?.
Comments
Comment #1
dopry commentedwhy not tell use what sql syntax error you're getting... I don't think you can block other uploads...
Comment #2
etion commentedThis is the sql 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.10.27/includes/database.mysql.inc on line 172.
* 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.10.27/includes/database.mysql.inc on line 172.
Comment #3
stockliasteroid commentedI'm getting the exact same error, though I haven't been able to narrow it down to be repeatable yet. I thought that it was perhaps related to http://drupal.org/node/180023, but my PHP max_post_size is set to 32M, and my upload_max_filesize is set to 10M. So, it doesn't seem that the cause is the same, since the uploaded files are nowhere near that large.
The other strange thing is that it seems to upload and save the files just fine. Once the user goes through the upload/attach/repeat process to upload all of their images, they get the error after saving the node. However, the images are there as expected, regardless of the error.
I'll report back if I can find a regular way to reproduce the error.
Comment #4
btopro commentedI had a student (I use this module as part of a course) replicate this error. Every time they try uploading an image this error occurs and they said that it doesn't allow them to submit the content. Somethings I can think of to maybe help troubleshoot this:
* I'm using jQuery update 1.0 (not sure if it's related or if I should be using 2)
* The fields were originally created using an older version of ImageField (1.x branch)
Comment #5
drewish commentedmarked #287684: The selected image handling toolkit imagemagick can not correctly process image_imagemagick_resize. as a duplicate
Comment #6
paulnem commentedSeems the same problem for me after upgrading to the latest imagefield (2.1). I also created the fields with the 1.x branch of imagefield.
Other versions :
Drupal 5.9
CCK 5.x-1.7
ImageAPI 5.x-1.2
ImageField 5.x-2.1
Jquery_Update 5.x-2.0
files/tmp dirs are public and owned by the apache daemon user and don't have a problem being used.
MySql 5.0.51b
Apache 2.2.9
PHP 5.2.6
Comment #7
dopry commentedhey is devel installed? is it messing up your js? btw... the ajax upload on this doesn't use jquery...
Comment #8
trogie commentedI'm getting this problem on a fresh drupal 5.9 install with only cck installed...
PS: it also looks like my 'imagefield' field settings are not being saved.
Comment #9
paulnem commenteddevel is not installed for me.
The only changes to the environment around the time of this error starting was the upgrade of a couple of modules.
Drupal 5.9 (from 5.8)
Imagefield 2.1
Installed ImageAPI 1.2
ImageCache 2.1 (from 1.6)
Thickbox 2.0 (from 1.2)
Comment #10
tmcw commentedThis also happens on the latest dev version of the Drupal 5 branch of ImageField. I'm betting the issue's in FileField, though.
Comment #11
paulnem commentedIs there any other information we can provide on this error?
I'm still getting the 2 errors on a consistant basis, but I've been unable to duplicate it myself. However some users are obviously having some sort of problem as they never finish creating the node.
1. 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 /www/thesite/www/includes/database.mysqli.inc on line 154.
2. The selected image handling toolkit imagemagick can not correctly process image_imagemagick_resize.
There are the 2 errors, sometimes together, sometimes individually, maybe just once or multiple errors.
Comment #12
paulnem commentedIs there any update or further information that can be provided?
Comment #13
dopry commentedI haven't been able to reproduce this locally. I really need a dump of what is showing up in the js callback and the node_field_instance table for these sites.
Comment #14
stormsh commentedAny progress on this issue?
Comment #15
Sam Roy commentedI'm having the same SQL error message, but with the file field module. Not easy to duplicate either. I always get the error when an argument is passed to node/add URL.
Comment #16
gaele commentedI'm seeing the same error message. Drupal 5.10 and imagefield 5.x-2.1.
Watchdog error:
'slideshow-image' is the name of my content type. The URL http://www.example.com/imagefield/js seems to be causing the error.
From the source of http://www.example.com/node/add/slideshow-image:
Line 726 of imagefield.module:
Something wrong here?
Comment #17
gaele commentedA call to http://www.example.com/imagefield/js generates the SQL error in the watchdog, and this error page:
Fatal error: Cannot access empty property in /my_path/www.example.com/sites/all/modules/imagefield/imagefield.module on line 1143
(Hmm, bad error handling)
Comment #18
Evil Otto commentedI am also having trouble with multiple simultaneous uploads on my site. What seems to happen is the first upload proceeds as expected, but the second one gets stuck in the middle of the uploading process (Uploading image) and I cannot continue. I can't even preview or back out of the change, because what's happening is that both the image fields are 'required' and I have no way to continue other than creating the node over again. I don't know if this is the same bug/issue as what's being described here.
Is there some javascript-y way to disable other upload buttons while an upload is proceeding, and re-enable them once the upload is finished? It seems like that would be an acceptable compromise. (I have five imagefield fields on this particular node type.)
Comment #19
Evil Otto commentedAny insight on the multiple simultaneous upload issue?
Comment #20
paulnem commentedI don't believe this just relates to multiple simultaneous uploads. I can recreate this issue when uploading 1 photo, this is to a node with 2 cck image fields but I'm not trying to upload to both at once.
It also seems like some images always do it, while others never do. So possible the image handling portion is just not dealing with things well??
Comment #21
pathfinderelite commentedI have the same problem with imagefield 2.2. The error messages (one Mysql and one PHP from what I can tell) are being thrown from function calls made within the
imagefield_js()function. This function sets the$fieldnamevariable to the result of apreg_matchcall (php regular expression match).However, if the
preg_matchcall fails to return any matches (or the call is never made, which is possible since it is inside a conditional), the$fieldnamevariable is not set. The rest of theimagefield_js()heavily uses$fieldname, but their is no check to ensure that the variable is defined. So, when these functions use the undefined variable, it ultimately results in some error messages.I think there are two things that need to be done:
First, enclose the rest of the function in a conditional which checks if
$fieldnameis defined.Second, determine why
$fieldnameis not being defined. This is the root of the problem, and could be caused if either thepreg_matchdoes not return any matches or the $POST variable is empty.Comment #22
quicksketchUnless this problem can be reproduced from a fresh install of the latest ImageField (currently 2.6 in Drupal 5), this problem will remain unfixable. Since there haven't been any posts in 5 months I'm hope this was fixed in a later version of ImageField. Drupal 5 is now maintenance only, so this problem qualifies for getting fixed, but the maintainers are no longer developing any sites on Drupal 5, so this problem will only be fixed if a patch is submitted.
I'm moving this to won't fix, post a patch along with a complete outline of how to reproduce the problem if needing this to be fixed.
Comment #23
tevih commentedI just got this, too. Fresh install. All my modules are up to date.
Comment #24
plan9 commentedI have this error appearing in watchdog also. 5.x branch - all modules up to date.
Comment #25
abautu commentedFor me (from our logs I see) this happens mostly on IE (7 & 8), but I got it on a few occasions from Chrome and Firefox, too (very rare).
This is how I am able to reproduce this in IE8/WinXP (both with IE7 compatibility on and off):
1. select an image to upload
2. click on upload
3. when the picture starts uploading (while the upload button fades out) click the upload button again (some users do this because they double-click); you will now see two upload bars and when they will finish, you'll get the error message.
You might not get it on the first try, but try it a few times to get your hand on and you'll be able to reproduce whenever you want.
The same problem happens in Opera 10 (which uses the same rendering engine as Chrome). I can't reproduce it in Firefox (which uses a different rendering engine AFAIK).
Saving the POST data for each request in different files, I noticed this: the first request is interrupted by clicking the upload button again (thus resending the form a second time). When this happens, submitted data is truncated: for IE, fields after the upload field are not send (including the cck_imagefield_..._op button data); for Opera, all fields are not send (POST is empty). In both cases, imagefield_js will not get the cck_imagefield_..._op information it needs. The larger the image, the greater chances are that you're second click will interrupt the first form submit.
I agree with pathfinderelite (#21) about the first fix.
Edit: After looking more into the code, it seems pathfinderelite's fix can be applied because Ajax upload code expects the updated form to be returned by imagefield_js. If we put this inside an if, we'll be left with no form.
A quick fix I found for this problem, is this:
Comment #26
plan9 commented@abautu: Thanks for sharing your quick fix. It seem to have solved the problem in my 5.x install.
Shame to have to resort to core hacks though.
Comment #27
chrisd commentedI had a Drupal upload (image upload or attachment upload) issue. Here what helped me:
http://www.sitebuddy.com/drupal-error/upload-image-attachment