I'm just trying to pinpoint the cause of these error messages on node creation, perhaps you can help:

Warning: Parameter 1 to calais_calais_preprocess() expected to be a reference, value given in module_invoke_all() (line 483 of /home/login/public_html/example.com/includes/module.inc).

Warning: Parameter 2 to calais_tagmods_calais_preprocess() expected to be a reference, value given in module_invoke_all() (line 483 of /home/login/public_html/example.com/includes/module.inc).

I should state that nodes seem to be created okay and Calais works fine...

Comments

febbraro’s picture

What version of Drupal and PHP are you using?

arnold_mad’s picture

Same happens for me with drupal 6.19 PHP 5.3.2-1ubuntu4.2 and calais 6.x-3.5 module when I edit pages.

ddd2500’s picture

I have the same trouble but different in php5.3.3-php-fpm

febbraro’s picture

Status: Active » Postponed (maintainer needs more info)

I can't reproduce this b/c I dont have PHP 5.3 installed anywhere. IF someone can figure how what is going on and provide a patch I would be more than happy to fix it.

JurgenHeiman’s picture

See also http://drupal.org/node/728486
Couldn't use the patch because user_view is different.

It has probably something to do with PHP 5.3

michael330’s picture

Version: 6.x-3.4 » 6.x-1.4

I'm also having the exact same two errors. Looks like the calais_calais_preprocess() error is stopping calais from creating a vocabulary for entities, and the calais_tagmods_calais_preprocess() error prevents the blacklist and substitutions from working correctly.

I am also using PHP 5.3 (with Drupal 6.17)

Anyone have any ideas?

EDIT: I reverted to PHP 5.2.11 and the error message went away.

toddwshaffer’s picture

Status: Postponed (maintainer needs more info) » Active

I'm running Drupal 6.20 with OpenPublish with Calais on Ubuntu.

I started getting this exact error message on Article/Node creation or modification after upgrading to PHP 5.3 + Pear's Upload Progress module... Michael330 says reverting to PHP 5.2 fixed his problem, but I'd rather see a fix come out for Calais to support 5.3 :)

allan1015’s picture

Oh my, I have ot revert back from 5.3 to get Calai support
And I loose the upload module support if i do.

this is a bummer

allan1015’s picture

Apparently an old issue and others mods have been patched , this article says fix is easy but right now its beyond me

http://drupal.org/node/360605

allan1015’s picture

If it helps
It seems this function (calias_tagmods.module)
function calais_tagmods_calais_preprocess($node, &$keywords) {
wants keywords as a reference

I think the calling is being done here (calais.module)
module_invoke_all('calais_preprocess', $node, $keywords);

However i tried changing to &$keywords and it didnt change anything

liren.zhu’s picture

Version: 6.x-1.4 » 6.x-3.5
Status: Active » Needs review
StatusFileSize
new480 bytes

Simple fix, attached is a patch.

If no issues, please commit.

Curvemedia’s picture

Thank you patch worked!

allan1015’s picture

Version: 6.x-3.5 » 6.x-3.x-dev
Category: support » bug

patch worked for me - had the issue for some time.
on the latest Calais 6.x-3.x-dev (2011-Feb-25) and patch still needed
Would love to see this committed

febbraro’s picture

Status: Needs review » Needs work

#11 is not the right fix. The reason the error went away is that it is no longer calling that hook. user_module_invoke is trying to call hook_user with $op = 'calais_preprocess'. I'm still not using PHP 5.3 anywhere so I can't debug this yet, but I know that the patch in #11 needs to be reworked. Will try to read up on #360605 so we can get the right fix in.

allan1015’s picture

Do you need access to a 5.3 setup?
What would you need?

liren.zhu’s picture

It's a Drupal 6 Core-PHP 5.3 issue, not a Calais-PHP 5.3 issue. The patch was meant to simply get rid of the error, which works from a user perspective.

This will be an issue for a lot of modules running on Drupal 6 and PHP 5.3. At the same time, some modules will have adopted the same fix, for now. Question is what do you fix, core or modules?

allan1015’s picture

Just to be clear, does the warning, or the patch to get rid of the warning, mean tag creation is or isn't happening?
I notice that Calais is always processing every cron run "Processed 25 nodes with Calais",
I am not sure if this means it is retrying and failing, or this is how it works

Doesn't seem Core guys care about fixing this, I don't mind suppressing the message but unclear how it affects Calais tagging overall

Alphabool’s picture

I'm having the same issue with Calais 6.x-3.5 and PHP 5.3. It does not appear that tag creation is failing as all the nodes I have created generate this error but are still tagged by Calais.

jthomasbailey’s picture

Subscribing, patch works to hide errors but text fields don't seem to be processed. URLs work most of the time, though.

arpieb’s picture

Status: Needs work » Patch (to be ported)
StatusFileSize
new1.4 KB

I just ran into the same thing on an Ubuntu 10.04 LTS RS Cloudserver running D6.20 and PHP 5.3.2. After looking at what it was trying to do, I modeled the attached patch after the hook_nodepai invocation code as it handles arguments passed by reference properly (and is trying to do the same thing - allow the hook to modify the passed in args).

The patch in #11 is incorrect as it invokes hook_user, which has nothing to do with what the code is trying to do.

I hope this helps someone as it appears to be working on my site now... And since this patch is modeled after a call already existing in the core node.module, it should be fine on any version of PHP supported by D6.

kaustavdm’s picture

#20 arpieb's patch works for me. Using Openpublish on Drupal 6.20 with PHP 5.3 running on Ubuntu server 11.04 64-bit at home and Ubuntu server 10.04 LTS on RackSpace CloudServer.

geerlingguy’s picture

Status: Patch (to be ported) » Needs review

Still CNR - I'm having this problem after upgrading to 5.3.2 on CentOS 5.6.

febbraro’s picture

Status: Needs review » Fixed
LR’s picture

If I understood, the patch provided in #11 removes the error but causes problems in opencalais.

But I don't see how the one provided in #20 could help since the error concerns the call of the function calais_calais_preprocess from module.inc and the patch modifies the code in calais_process_node.

If the problem is that this line
$result = call_user_func_array($function, $args);
in module.inc calls calais_calais_preprocess with arguments by value where calais_calais_preprocess waits arguments by reference, I don't see how this patch could solve the problem.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.