The upload_image_save function handles each $node->files as an array instead of a StdClass. Attached patch should fix this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| upload_image_file_class.patch | 635 bytes | moonray |
The upload_image_save function handles each $node->files as an array instead of a StdClass. Attached patch should fix this issue.
| Comment | File | Size | Author |
|---|---|---|---|
| upload_image_file_class.patch | 635 bytes | moonray |
Comments
Comment #1
drewish commentedit had been an object but i'd switched it to an array because that's what was coming in form the form. what operation were you performing when you ran into the error? and what was the error?
i'd be much more into committing the change if you explicitly cast $file to an object or an array...
Comment #2
moonray commentedI was using the category_outliner module to edit the title of the page.
The module loads the node into memory, then saves it.
As such, it never goes through a form...
I'm leaving on a 6 week vacation, so I doubt I'll have more time to work on this right now.
If I do, you'll see a patch appear in this issue before long. If not, feel free to modify the patch.
Comment #3
drupalninja99 commentedhere's the error i'm getting:
Fatal error: Cannot use object of type stdClass as array in /Users/jaycallicott/Sites/estatesalesdallas/modules/upload_image/upload_image.module on line 136
Comment #4
drupalninja99 commentedhere's a mini patch, line #136
if ($file->remove && ereg('^(image/)', $file->filemime)) {
Comment #5
drewish commentedjaykali, did you read the comments i've already left on this issue? you need to explicitly cast it to an object or an array. because it seems to vary between installations.
Comment #6
killes@www.drop.org commentedthis seems to be all working fine on php 5.2