Closed (fixed)
Project:
ImageField
Version:
5.x-2.0-rc2
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Dec 2007 at 18:21 UTC
Updated:
12 Jan 2008 at 18:11 UTC
In the very latest dev (dec 18) an error has cropped up. This wasn't in the penultimate dev release from dec 16 (?)
warning: Invalid argument supplied for foreach() in ......../modules/imagefield/imagefield.module on line 252.
warning: array_values() [function.array-values]: The argument should be an array in ......../modules/imagefield/imagefield.module on line 260.
Comments
Comment #1
dopry commentedAnd what were you doing when you saw this error? It's wonderful to know you saw the error, but if I don't have directions to reproduce it I can't fix it.
Comment #2
bobdalob commentedsorry::
node creation. the error arose whether uploading an image or previewing the node (without using the upload button) and the error was shown in the image field form on the node create page.
Filename does not appear to matter and the node can go on to be published with no apparent problem.
I cannot pinpoint any trigger factors or sequences - I've tested filenames, I've tried upload/preview/replace etc. - there's no apparent consistency or pattern I can identify. It happens most times but not every time.
There was no such issue with the earlier dev releases and everything else is the same (config of image field module and rest of site is the same).
Comment #3
dopry commentedHow is the imagefield configured?
Comment #4
bobdalob commentedsingle image field, max. 480x480, image path [user-raw], default file extensions, custom title text enabled, not required, no multiple values.
cck is 1.6-1, public download, jquery is 1.2.1, drupal 5.5, php 5.2.3, mysql 5.0.24a. the module is unpatched and again nothing was changed between a previous dev version being error-free and this version. I didn't keep a copy of the previous version however I have now reverted to 2.0-rc1 and the error does not occur.
** edited **
if I go back to the dev release the error occurs again.
wish I could somehow be more helpful. I cannot seem to find a copy of the penultimate release
Comment #5
jpetso commentedstatus.
Comment #6
bobdalob commentedJust to add a couple more observations, same release:
No image = "missing image"
Even if image field is empty, the published node tries to show the image field:
...../files/imagecache/imageview" alt="" title="" />....
whereas a node with an image, the img src is:
...../files/imagecache/imageview/files/dummy/testpic.jpg" alt="testpic.jpg" title="Test pic" />...
imageview is the imagecache preset, dummy is the [user-raw] token
No image, no php error
If no image is attached to a node, the php error does not occur (on preview or submit, it will occur if "upload" is hit with an empty field).
Comment #7
vm commentedI can confirm this.
version 1.2 RC1 doesn't have this error
version 2.0 RC1 doesn't have this error
version 2.0-dev does.
The image itself still shows though even though the error is produced.
Comment #8
jaydub commentedI can also confirm this bug. If you examine the RC1 source you can see that the code block that is referenced in the error above was wrapped in a test condition in RC1 but not in the dev version.
I added the test condition from RC1 and the error goes away.
Comment #9
vm commentedconfirmed that using the code above fixes the error message but introduces another bug.
After the image is uploaded and submitted.
edit the node, the image already attached cannot be edited the way it's supposed to be edited.
Comment #10
bobdalob commentedI can also confirm this fix along with minor bug (saw this yesterday but initially I [wrongly] attributed this elsewhere)
In node edit, previously published images are not shown.
Images will be re-appear in the image field form if you hit the upload button whether you are uploading further images or just leaving the browse box empty. Even if you make no changes the original images will re-appear in node view when re-submitted.
Comment #11
vm commentedthe release of 2.0 RC2 fixes the error that was originally seen.
will file a seperate report for the fact that when after an image is uploaded, when you enter the edit screen of a node there is no delete checkbox.
Comment #12
dopry commentedThis should be fixed in RC2.
Comment #13
dopry commentedwow people close my issues quicker than I can...
Comment #14
vm commentedmy apologies. I am watching this module closely because I'd love to implement it on a site I am working on to promote some music with an image. Didn't mean to close it quicker than you could ; )
Comment #15
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.