| Project: | Auto Tagging |
| Version: | 6.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | task |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | needs review |
Issue Summary
I have assigned story type for autotagging. Got the api keys for all 3 i.e. yahoo n all.
But getting warning as
* warning: Parameter 1 to alchemy_autotagging_autotagging_api_insert() expected to be a reference, value given in C:\wamp\www\drupalfun\includes\module.inc on line 462.
* warning: Parameter 1 to autotagging_calais_autotagging_api_insert() expected to be a reference, value given in C:\wamp\www\drupalfun\includes\module.inc on line 462.
* warning: Parameter 1 to autotagging_tagthenet_autotagging_api_insert() expected to be a reference, value given in C:\wamp\www\drupalfun\includes\module.inc on line 462.
* warning: Parameter 1 to autotagging_yahoo_terms_autotagging_api_insert() expected to be a reference, value given in C:\wamp\www\drupalfun\includes\module.inc on line 462.
Comments
#1
So, what's happening here is that in PHP 5.3, at least in Ubuntu 10.04, the ini value 'allow_call_time_pass_reference' is no longer set to 1 (TRUE) by default. In Ubuntu 9.10 running PHP 5.2.x (and I assume on other systems) this ini value was set to TRUE, and thus this module would work on those systems. I just got bit bad by this and spent an hour tracking it down.
What needs to happen is to refactor the code a bit to take the approach mentioned here: http://api.drupal.org/api/drupal/includes--module.inc/function/module_in...
For further info, take a look at this issue here: http://drupal.org/node/353494
Sorry, but it's past 4am and I'm too tired to write a patch, but the patch should be fairly simple.
#2
Eh, I lied, I needed the patch so here it is. It's simple, so pasting it in as well as attaching for the benefit of others:
--- autotagging.module 2009-07-24 17:38:20.000000000 +0000+++ autotagging.module 2011-02-27 13:07:45.000000000 +0000
@@ -51,8 +51,10 @@ function autotagging_nodeapi(&$node, $op
$text[] = str_replace("\n", ' ', $node->body);
$text = implode(' ', $text);
$ignore_setting = variable_get('autotagging_error_handling', 'Defer');
- foreach (module_implements('autotagging_api_' . $op) as $module_name) {
- $terms = module_invoke($module_name, 'autotagging_api_'. $op, $node, $text);
+ $hook = 'autotagging_api_' . $op;
+ foreach (module_implements($hook) as $module_name) {
+ $function = $module_name . '_' . $hook;
+ $terms = $function($node, $text);
if ($terms === FALSE) {
// error occurred processing this node for this service
if ($ignore_setting == 'Defer') {
#3
#4
am having the same error in 7.x version.
can you suggest a patch for this version?
thank you :)
#5
i forgot to paste the error message, here it is...
Warning: Parameter 1 to autotagging_node_presave() expected to be a reference, value given in module_invoke_all() (line 819 of /var/www/cms/drupal/includes/module.inc).thank you
#6
#7
@toxiclung: Please create a new issue for the 7.x. version, you can just copy and paste from this one. That way we can provide separate patches for each version and people will be able to find them fairly easily. You should probably go ahead and provide a link to the new issue you create from here as well, so people can find it if they end up here looking for the 7 fix.
#8
thanks @nowarninglabel :)
i have created the new issue for 7.x in here: #1125670: Warning: Parameter 1 to autotagging_node_presave() expected to be a reference
please help