Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Using Drupal 6.14 with PHP 5.3.0, i get this error instead of the imagefield_widget:
warning: Parameter 1 to theme_imagefield_widget() expected to be a reference, value given in C:\server\htdocs\drupal\includes\theme.inc on line 617.
Comment | File | Size | Author |
---|---|---|---|
#1 | image_field_remove_reference.patch | 692 bytes | quicksketch |
Comments
Comment #1
quicksketchI've committed this patch which should correct this problem.
Comment #3
dom_b CreditAttribution: dom_b commentedI have same error on php 5.3.
Comment #4
quinn-2 CreditAttribution: quinn-2 commentedIs there a plan to roll this into a release of imagefield?
Comment #5
ifernando CreditAttribution: ifernando commentedThis problem can be resolved by removing in the file imagefield_widget.inc the & in the function. That is,
function theme_imagefield_widget(&$element) -> function theme_imagefield_widget($element)
Comment #6
koorneef CreditAttribution: koorneef commentedPatch in #1 is working, please apply to source.
Thanks.
Comment #7
quicksketchThis has been committed ever since I marked fixed in #1.
Comment #8
rdgouw CreditAttribution: rdgouw commentedHi,
Similar issue here: with an when editing a node with an imagefield this error message is displayed.
warning: Parameter 1 to imagefield_widget() expected to be a reference, value given
How can I solve this?
Richard
Comment #9
joecanti CreditAttribution: joecanti commentedHi,
I get the same problem here - using php 5.3 but only seems to be a problem when using with the image_fupload module??
Richard did you solve this?
Any help much appreciated,
Thanks, joe
Comment #10
joecanti CreditAttribution: joecanti commentedlooks like a similar problem occurs with the image_fupload module and that's probably the source - there is a patch here - http://drupal.org/node/619632 - will post back when tried
Comment #11
Manuel Garcia CreditAttribution: Manuel Garcia commentedthis is still happening in the latest stable release:
In the file
image_fupload/image_fupload_imagefield/image_fupload_imagefield_widget.inc
, the theme function should not take $element as reference as it is now, at least, changing it to a normal argument seems to have fixed the problem on my test install:Comment #12
cha0s CreditAttribution: cha0s commentedChanging project.
Comment #13
yan CreditAttribution: yan commentedI'm getting the same problem with ImageField 6.x-3.7 since using PHP 5.3. Patch from #1 doesn't seem to be enough.
This issue was 'kidnapped' by another module, doesn't look correct to me. Can we move it back to imagefield?
Comment #14
yan CreditAttribution: yan commentedTo add: I don't use the Image FUpload module.
Comment #15
grandcat CreditAttribution: grandcat commentedComment #16
quicksketchThis problem has been fixed in ImageField for months. Please do not reopen again.
Comment #17
grandcat CreditAttribution: grandcat commentedSorry. I just forwarded it.
Comment #18
rufpoet CreditAttribution: rufpoet commentedtheme_imagefield_widget() expected to be a reference, value given in /usr/share/drupal/core/includes/theme.inc on line 656
I have applied the previous patch but this is still occuring.
Php 5.3
Please advise
Thank you in advance
Comment #19
chrisck CreditAttribution: chrisck commented#5 works for me.
I removed the &
Comment #20
loze CreditAttribution: loze commentedIm getting the error
warning: Parameter 1 to imagefield_widget() expected to be a reference, value given in includes/module.inc on line 462.
using the latest stable release.
php 5.3
Comment #21
pcoughlin CreditAttribution: pcoughlin commentedChanged:
./sites/default/modules/linkimagefield/linkimagefield_widget.inc:function theme_linkimagefield_widget(&$element) {
to:
./sites/default/modules/linkimagefield/linkimagefield_widget.inc:function theme_linkimagefield_widget($element) {
Problem went away and seems to work fine.
Comment #22
quicksketch@pcoughlin: This has already been corrected. Use the latest version.
Comment #23
ratinakage CreditAttribution: ratinakage commentedOops. Wrong thread.
Comment #24
ratinakage CreditAttribution: ratinakage commentedComment #25
JirkaRybka CreditAttribution: JirkaRybka commentedAs per #20, I have the same problem: The by-reference passing throws a warning at imagefield_widget() calls through module.inc. This happens with the latest stable release 6.x-3.10 running on PHP 5.3 (enforced by hosting provider for security reasons, no workaround available), and I see that the latest code in repository is not changed here.
This is critical, because it's a data-loss issue. A CCK content type uses imagefield (with Image FUpload). Initial creation of a node works more or less fine, but once the node is later edited (to update textual description in another field, typically), on submit of the node form, image is unintentionally deleted. If I remove the two '&' signs from the function definition then it works fine, but it's going clearly against the documented fact that 'FileField needs to modify $form by reference', so I guess this needs more consideration. I guess this is related to the fact that PHP 5.3 not only throws warning if a value is given in a by-reference call, but it also discards that value and passes a NULL into the function instead.
Comment #26
quicksketch@JirkaRybka: Make a suggestion (through a patch) and I'll look at it. As far as I know this is solved. I've been running PHP 5.3 in production on many sites with ImageField.
Comment #27
ben.hamelin CreditAttribution: ben.hamelin commentedJust ran into this after a server wide upgrade to PHP 5.3.x branch.
Coincidentally we had two content types on a particular site, both using the Image File field type, however one was showing, one was not and throwing the error.
The difference was in the "Widget Type" setting - "Link Image" was not working, "Image" was.
After changing the Widget Type to Image I was back up and running.
Add and Edit node forms both functioning with no other changes.
I did however take the opportunity to update to latest versions of ImageField and FileField.
Comment #28
iwan_s CreditAttribution: iwan_s commentedfor Posted by ifernando ...
thank u very much..
Comment #29
quicksketchThis problem was fixed long, long ago. The pass-by-reference in theme_imagefield_widget() has been fixed since September 18th, 2009 (the same day this issue was filed, see http://drupalcode.org/project/imagefield.git/commitdiff/62265aec4b64c108...). Please do not, for any reason, reopen this issue. File a new issue if you having trouble with ImageField and PHP 5.3 specifically.
Comment #30
hockey2112 CreditAttribution: hockey2112 commented#21 fixed my issue.