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.
Hi,
Issue with displaying Link Image widget, showing error:
warning: Parameter 1 to theme_linkimagefield_widget() expected to be a reference, value given
This one was fixed for ImageField module in #581074: Widget does not show up. (PHP 5.3.0). Have to be corrected in the LinkImageField too.
Software configuration: Drupal 6.16, PHP 5.3.0, ImageField 6.x-3.2.
Comment | File | Size | Author |
---|---|---|---|
#17 | linkimagefield-no_widget-759492-17.patch | 599 bytes | robaminima |
#15 | 759492-15-linkimagefield-no_widget_php_53.patch | 1.16 KB | pfrenssen |
Comments
Comment #1
reufhaadfe CreditAttribution: reufhaadfe commentedEdit file linkimagefield_widget.inc at line number 180.
Edit function theme_linkimagefield_widget(&$element) {
Remove the & so that it looks like function theme_linkimagefield_widget($element) {
That works for me. :)
Comment #2
simonswiss CreditAttribution: simonswiss commentedI second that this #1 edit at line 180 works. It sorted my problem. Thank you tgrondin!
Comment #3
kettari CreditAttribution: kettari commentedtgrondin, I think this change should be made to the module itself.
Comment #4
scotwith1tThat worked great. Is it fair to assume this easy-to-do, minor tweak (that causes the module not to work at all) has at least made it to the latest dev snapshot? Shouldn't it be committed if it's making it non-functioning? Thanks for a great module though, for real. Not sure why this isn't just an optional setting in imagefield...that would be better than a separate module. Has that ever been explored/considered with those folks?
Comment #5
anjjriit CreditAttribution: anjjriit commentedGreat module, my site using this module is http://www.primastar-mandiri.com/project-reference.html, thank so much for release tis module
Comment #6
ch_masson CreditAttribution: ch_masson commentedIsn't the & versus no & on line 180 a php version issue?
I believe that php 5.3.x passes argument by value (no &) versus php 5.2.x passes arguments by reference (& needed)
So it could be that the reason we need to remove the & is because we have php 5.3.x. I would be curious to know if someone runs php 5.2.x would need to remove the &.
Comment #7
mandreato CreditAttribution: mandreato commentedIs there any patch to correct this issue or must I change manually the code as tgrondin suggested ?
Comment #8
lameei CreditAttribution: lameei commentedI did the same mentioned in #1 and it is working now. Please inform when it is solved in releases.
Thanks
Comment #9
radutz CreditAttribution: radutz commentedIt works
Thanx
Comment #10
funcrunch CreditAttribution: funcrunch commentedThanks tgrondin for finding a simple one-character fix for this issue. I can confirm that my linkimage widgets stopped showing up when my web host updated the PHP version to 5.3 recently, so this problem was quite vexing. I hope there will be a new release soon that includes this fix.
Comment #11
janis_lv CreditAttribution: janis_lv commentedthat fixes it for me too, thank you :)
Comment #12
opiworks fine for me too
Comment #13
greekk.com CreditAttribution: greekk.com commentedRight way.
Thanks!
Comment #14
dejavu_007 CreditAttribution: dejavu_007 commentedMarked #1350854: Link Image not showing in node edit as duplicate of this issue.
Comment #15
pfrenssenHere is a patch that contains the fix from #1. It also updates the documentation of this function.
Comment #16
R.Hendel CreditAttribution: R.Hendel commentedThanks a lot. Patch works for me fine :-)
Comment #17
robaminima CreditAttribution: robaminima commentedRemoved headers on patch that blocked me from applying the patch.
Comment #18
pfrenssen@robaminima: That should not be necessary, these headers contain metadata and are fully compatible with git and the standard patch tool. If your software does not support this then this is a bug in your software and you should report it to the developers.
Comment #19
kutter CreditAttribution: kutter commented@pfrenssen Patch works like a charm. Thanks!
Comment #20
tommyent CreditAttribution: tommyent commentedWish I found this sooner. Works.
Is this going to get rolled?
Comment #21
SpiesInOrbit CreditAttribution: SpiesInOrbit commentedPatch worked for me
Comment #22
keypetery CreditAttribution: keypetery commentedMy ISP, Site5, just changed my site to PHP 5.3 (shared hosting -- I don't maintain the PHP myself). I'm just posting here in case anyone else runs into this issue to mention that the patch worked for me. I simply went to the linkimagefield directory, found linkimagefield_widget.inc and changed
'function theme_imagefield_widget(&$element)'
to
'function theme_imagefield_widget($element)'
That is, I took out the & .
Thanks pfrenssen, et al!
Comment #23
keva CreditAttribution: keva commentedCan this very simple change be committed? The patch has been well reviewed and works.