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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

reufhaadfe’s picture

Edit 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. :)

simonswiss’s picture

I second that this #1 edit at line 180 works. It sorted my problem. Thank you tgrondin!

kettari’s picture

Status: Active » Needs work

tgrondin, I think this change should be made to the module itself.

scotwith1t’s picture

That 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?

anjjriit’s picture

Great module, my site using this module is http://www.primastar-mandiri.com/project-reference.html, thank so much for release tis module

ch_masson’s picture

Isn'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 &.

mandreato’s picture

Is there any patch to correct this issue or must I change manually the code as tgrondin suggested ?

lameei’s picture

I did the same mentioned in #1 and it is working now. Please inform when it is solved in releases.
Thanks

radutz’s picture

It works
Thanx

funcrunch’s picture

Thanks 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.

janis_lv’s picture

that fixes it for me too, thank you :)

opi’s picture

works fine for me too

greekk.com’s picture

Right way.
Thanks!

dejavu_007’s picture

Marked #1350854: Link Image not showing in node edit as duplicate of this issue.

pfrenssen’s picture

Version: 6.x-1.0-beta2 » 6.x-1.x-dev
Status: Needs work » Needs review
FileSize
1.16 KB

Here is a patch that contains the fix from #1. It also updates the documentation of this function.

R.Hendel’s picture

Status: Needs review » Reviewed & tested by the community

Thanks a lot. Patch works for me fine :-)

robaminima’s picture

Removed headers on patch that blocked me from applying the patch.

pfrenssen’s picture

@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.

kutter’s picture

@pfrenssen Patch works like a charm. Thanks!

tommyent’s picture

Wish I found this sooner. Works.
Is this going to get rolled?

SpiesInOrbit’s picture

Patch worked for me

keypetery’s picture

My 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!

keva’s picture

Issue summary: View changes

Can this very simple change be committed? The patch has been well reviewed and works.