Hi everybody,

thanks for great module, however, I am having some troubles with it. The error, as the title of this call says, is

> Parameter 1 to imagefield_widget() expected to be a reference, value given in .../includes/module.inc on line 476

where ... is the path to the drupal installation directory. It is being displayed on node/edit page.

Drupal core: 6.26
FileField module: 6.x-3.10
CCK: 6.x-2.9
ImageField 6.x-3.10

(all up to date).

update.php run after updates succesfully, cache cleared.

Thanks for the support!

CommentFileSizeAuthor
#4 imagefield_widget_reference.patch494 bytesquicksketch

Comments

petiar’s picture

Priority: Normal » Critical

Customer can't upload images, so this is critical now.

Thanks for your help.

Sander van Dragt’s picture

I had this problem. Because of a different error users reported success by adding manual module_load_invoke() calls in this module. However now parts of the module are loaded twice after solved the original problem by editing /etc/php5/apache2/conf.d/apc.ini and changing the following line from 1 to 0:

apc.include_once_override = 0

Restart apache. Now include/require_once calls are not overridden, they will work properly. Remove all customizations to the filefield module by using the original files. Then the problem disappeared for me.

petiar’s picture

Unfortunately, I do not have access to Apache and/or PHP configuration...

quicksketch’s picture

Priority: Critical » Normal
Status: Active » Fixed
StatusFileSize
new494 bytes

> Parameter 1 to imagefield_widget() expected to be a reference, value given in .../includes/module.inc on line 476

Well I haven't seen this problem myself. I think it's likely to be a PHP configuration issue like #2 suggests. However we can easily fix this exact error by fixing exactly what has been described (that a reference was expected but a value came in). I've committed this patch, hopefully it will help with your situation. It'll be in the 3.11 that will be coming out shortly.

quicksketch’s picture

Category: bug » support
Status: Fixed » Postponed (maintainer needs more info)

Hm, actually I had to roll #4 back. Passing the $form by reference is required to validate required values properly.

If you can give me instructions on reproducing the problem I'll have another look. Right now I don't have any ability to discover where this problem originates.

mdorman’s picture

I had patched my own site before finding this. I have image_fupload installed, and when you go back to edit a node that already has images I was seeing the above warning, and no images showing on the node edit page.

However, applying the patch in #4 above just shifted the warning to Parameter 2 when I tried it. Removing both allows for the images to show up.

I see if there is anything else I can find from my end.

geerlingguy’s picture

Issue summary: View changes
Status: Postponed (maintainer needs more info) » Closed (works as designed)

This is likely an issue with image_fupload. Check out patch at #619632-42: PHP5.3 error: warning: Parameter 1 to imagefield_widget() expected to be a reference and see if that fixes the issue.