Closed (fixed)
Project:
Rules
Version:
6.x-1.1
Component:
Rules Engine
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2010 at 19:21 UTC
Updated:
23 Mar 2010 at 09:07 UTC
I have a trigger rule in my project on event "Content is going to be saved" and I developed a module to generate some nodes by node_submit and node_save. The first node is saved, but for the second it appears this error:
"Fatal error: Cannot redeclare _doxologia_replace_diacritics() (previously declared in /modules/rules/rules/modules/php.rules.inc(107) : eval()'d code:1)" and I don't understand why because it is about another node.
Can someone help me?
Thanks
Magda
Comments
Comment #1
klausiSeems like you execute some custom PHP code in your rule, could you post that?
Comment #2
magdab commentedIn the trigger rule I have this code:
As a condition I have
In another module I try to generate some nodes by node_submit and node_save.
.....
$node1 = (object)$node1;
$node1 = node_submit($node1);
node_save($node1);
$node2 = (object)$node2;
$node2 = node_submit($node);
node_save($node2);
......
The first node is saved, but for the second it appears this error:
"Fatal error: Cannot redeclare _doxologia_replace_diacritics().
Probably I have to move the declaration of the function in another file, but I don't understand why it saw the same declaration if it is about another array node on the save.
Comment #3
klausiDeclaring a function in an evaluated PHP field is not a good idea, because if the field is evaluated twice in one run, then PHP cries out because you try to define a function twice. I would suggest to move the function definition to a custom module.
Comment #4
magdab commentedYes, the problem is solved if I'll move the function in another file.
Thanks