Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By sderrick on
When posting a comment I get a white page with the following message
Fatal error: Function name must be a string in /home/scott/www/includes/actions.inc on line 100
???
Any Clues? How can I figure out what is the problem?
Comments
Well I performed Hack sugury
Well I performed Hack surgery on the problem, and it seems to work, though what function is now not being called I can;t tell. The comment is posted.
***was***
else {
// If it's a configurable action, retrieve stored parameters.
if (is_numeric($action_ids)) {
$action = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = '%s'", $action_ids));
$function = $action->callback;
$context = array_merge($context, unserialize($action->parameters));
$result[$action_ids] = $function($object, $context, $a1, $a2);
}
***is now***
else {
// If it's a configurable action, retrieve stored parameters.
if (is_numeric($action_ids)) {
$action = db_fetch_object(db_query("SELECT * FROM {actions} WHERE aid = '%s'", $action_ids));
$function = $action->callback;
if (is_string($function)) {
$context = array_merge($context, unserialize($action->parameters));
$result[$action_ids] = $function($object, $context, $a1, $a2);
}
}
***end****
I have no idea why db_fetch_object is returning the wrong or a bogus object, but it is.
Seeing this too
I just started see this too today but am at a loss as to why it started... I didn't install any new modules today and have been working on my own code.
I will probably have to figure out the issue because hacking core is not maintainable... :(
Very weird.
Kristen
-Kristen
Profile: https://www.linkedin.com/in/kristenpol
Drupal 7 Multilingual Sites: http://kristen.org/book
Update.php
My guess is that when I ran my last update.php it wiped out my actions table for some reason. I had one email action and now it's gone. But, the *trigger* table is still referring to this now non-existent action! Thus, the error.
The code really should check that it's getting something "real" before calling the function, etc...
But, if you are having the same probably, just go to your triggers page and see which action is messed up, and then delete the action in the trigger_assignments table.
Kristen
-Kristen
Profile: https://www.linkedin.com/in/kristenpol
Drupal 7 Multilingual Sites: http://kristen.org/book
It works
That works for me. Thank you Kristen!
It happened again
Strangely enough this happened too me again today for another website so when I went to look it up I found my own post on how to solve it... ;)
Kristen
-Kristen
Profile: https://www.linkedin.com/in/kristenpol
Drupal 7 Multilingual Sites: http://kristen.org/book
Just to add to this: had the
Just to add to this: had the same problem and the trigger thing did solve it... :-)