Closed (fixed)
Project:
InsertNode
Version:
6.x-1.1
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
18 Oct 2009 at 10:46 UTC
Updated:
16 Mar 2010 at 04:30 UTC
I love InsertNode, it gives me exactly the functionality that I need. There is one issue though.
The module breaks cron. I get a fatal error and cron is not working. I have a node that uses php in order to create some dynamic content. This content is inserted in my nodes with InsertNode.
Cron breaks on the php code that is in my dynamic node. I don't see any reason why this code should be called by cron, but it is. Maybe this is due to the search module?
Does anyone know a fix for this?
Comments
Comment #1
AlexisWilke commentedCan you view those pages where you have the InsertNode tag when you are not logged in?
The main difference between CRON and you logged in is that CRON runs as anonymous.
Thank you.
Alexis Wilke
Comment #2
cronix commentedYes, you can view the pages when you are not logged on. Everyting was/is working ok. I noticed this bug when I ran cron manually.
Disabling InserNode made cron to work again. Cron also worked when I enabled the module after the first cron run. So I guess cron is indexing the node only once or when its modified?
Comment #3
AlexisWilke commentedHi Cronix,
Did you ever resolve this problem?
Otherwise, would you be able to share the PHP code you use in that node being inserted? That way, maybe I could reproduce the problem on my systems.
Thank you.
Alexis
Comment #4
cronix commentedHi Alexis,
I found a work around. Just use the php function_exists as a wrapper around your code. This will make sure that functions are only defined once during your php session.
Comment #5
AlexisWilke commentedAh! That explains. Yes, the same code may be executed multiple times. The "only" drawback with that technique is that the function may be created by someone else and not be compatible...
Thank you for sharing your fix!
Alexis Wilke
Comment #6
AlexisWilke commentedOkay, I wrote an entry in the Known Issues of the documentation in regard to this problem. I'm closing the issue since it is not something that can be fixed in the InsertNode module.
Thank you again for sharing your results!
Alexis Wilke