Fatal error: Only variables can be passed by reference in /var/www/html/modules/taxonomy_theme/taxonomy_theme.module on line 262

CommentFileSizeAuthor
#9 taxonomy_theme_7.module12.5 KBprofix898

Comments

profix898’s picture

Hi llizards!

Just to confirm that you are using
- Drupal 4.6
- taxonomy_theme 1.6.2.1 ?
- PHP 5

On my 4.6 install with PHP 5.0.4 (Linux) and 5.1.1 (Win32) I'm unable to confirm this
one! Can you tell me a bit more? What php-Version are you using? What platform?
How can I reproduce this bug? Does it always occur when viewing node/x with
taxonomy_all option? Only on some pages?

llizards’s picture

Apache/2.0.54 (Fedora)
PHP Version 5.0.5

Template selection method:All Taxonomy.

I have several taxonomy terms. The problem I just found out was I didnt select a them for each just the ones I want to change ... I then reset it so all terms had a theme and the above error code is now gone but it doenst change themes.

llizards’s picture

I am using the taxonomy_theme 1.6.2.1 ?
also the error

Fatal error: Only variables can be passed by reference in /var/www/html/modules/taxonomy_theme/taxonomy_theme.module on line 262

show up when I am an anonymous user

profix898’s picture

Since I'm still unable to reproduce I can only guess ;)
Please try to replace (on line 262)

$term = current(taxonomy_node_get_terms($nid));

with

$terms = taxonomy_node_get_terms($nid)
$term = current($terms);  OR $term = $terms[0];
llizards’s picture

Parse error: parse error, unexpected T_VARIABLE in /var/www/html/modules/taxonomy_theme/taxonomy_theme.module on line 263

on activating the module

profix898’s picture

That looks all very strange to me ... there is no T_VARIABLE ( = t('...') ) in line 263!
What else modules do you have installed? Any problems with one of them?
Try to disable all except the core modules and reactivate one after another.
Maybe you have any conflicting module or something ....

llizards’s picture

Fatal error: Only variables can be passed by reference in /var/www/html/modules/taxonomy_theme/taxonomy_theme.module on line 262

Took out all other modules except the core. Same issue.

profix898’s picture

Have you tried the code from #4. It should work!? In case it doesnt, try this:

$term = current(taxonomy_node_get_terms($nid));

change to

$term = current($terms = taxonomy_node_get_terms($nid));

A change has been made to the php engine with version 5.0.5. Look at:
http://the-stickman.com/web-development/php/php-505-fatal-error-only-var...

Please report whether this is working. I hope so ... ;)

profix898’s picture

StatusFileSize
new12.5 KB

I just installed php 5.0.5 on a linux vm and was able to reproduce your
issue. I modified the code according to #4 and now it works for me!
In case something went wrong with your changes when you tested #4
I attach my modified version. Please try it and tell me ...

llizards’s picture

That's got it,

Thanks.... I appreciate all your help

profix898’s picture

Status: Active » Fixed

I'm glad to hear its working now. Changes are committed to cvs
and will be available in 4.6/4.7 releases soon.

Anonymous’s picture

Status: Fixed » Closed (fixed)