hi,

the referencing node fields had not been shown and i got the error Parameter 1 to theme_node_widget_element() expected to be a reference, value given in /var/www/drupal6/includes/theme.inc on line 656. on node creation form.

i solved the problem by removing & sing in

// line 21 of node_widget.theme.inc
//function theme_node_widget_element(&$element) {
function theme_node_widget_element($element) {
...
}

i'm using latest php on ubuntu.

CommentFileSizeAuthor
#7 node_widget-php-5.3.patch4.25 KBlightweight
#3 891234.patch605 bytesfreelock

Comments

jaxpax’s picture

Experiencing the same thing. Is this bug still active, which is surprising if the only thing that needs to be done is removing the &, like described by takbar?

freelock’s picture

Issue tags: +PHP 5.3 compatibility

Hitting this also on one server. Turns out to be a PHP 5.3 compatibility issue -- PHP 5.3 complains and won't execute this theme function, rendering the entire module useless.

Because the function does not modify the argument, it doesn't need to be passed by reference, so removing the reference should not break anything in older PHP versions.

freelock’s picture

StatusFileSize
new605 bytes

Patch attached. Can somebody test and commit?

spuky’s picture

Status: Needs review » Reviewed & tested by the community

The Patch is fixing the issue for me...

I also think it should not harm older versions

but haven't done any testing with older php versions..

spuky’s picture

Status: Reviewed & tested by the community » Needs work

there are more PHP 5.3 problems...

in nodewidget/modules/content.node_widget.inc

function content_node_widget_is_empty(&$form, &$form_state)
should be
function content_node_widget_is_empty($form, $form_state)

same in nodewidget/modules/node.node_widget.inc

function node_node_widget_is_empty(&$form, &$form_state)
should be
function node_node_widget_is_empty($form, $form_state)

maybe more .... right now I have not the time to build a patch but maybe sombody wants to know...

ratinakage’s picture

Hi,

I went through the PHP files mentioned above and made the suggested change every time I saw an '&' in the function header. I'm a beginner in PHP so hopefully that was the right thing to do. I had to change the following three files:

node_widget.theme.inc - (This only fixed the problem on the edit page. The two below fixed it for clicking save.)
node.node_widget.inc
content.node_widget.inc

I've checked and the above fixes are not in the 6.x-1.x-dev branch.

Thanks!

lightweight’s picture

StatusFileSize
new4.25 KB

I've had to fix this for a customer site, too, and I've got a full patch for the module (6.x-1.0-beta4). Update 18 Oct 2013: this patch creates some other problems upon further testing.

lightweight’s picture

Ok, further testing suggests that this patch I submitted isn't a workable solution. I do not suggest using it! I'm moving to the current devel version to test it... Update: using the current (1 Oct 2013) dev version addressed my problems.