node_delete does not allow anon user (which is the user during cron) to delete nodes.
See: http://drupal.org/node/28142
(this is [or was] a problem in the spam module too: http://drupal.org/node/135410)
node_delete does not allow anon user (which is the user during cron) to delete nodes.
See: http://drupal.org/node/28142
(this is [or was] a problem in the spam module too: http://drupal.org/node/135410)
Comments
Comment #1
mcurry commentedTemporary workaround - while logged in to your site as admin, or as another user with 'delete nodes' access privileges, run cron.php
Comment #2
junyor commentedSubscribing.
This is getting a bit annoying. Every time we run cron, there's a list of the same ads that should be purged.
Comment #3
mcurry commentedElevating to 'critical'
Yup, it's annoying. Have you tried the workaround - run cron.php while logged in as a user having delete node permissions (admin, for example?)
I've made inquiries as to the appropriate method of deleting nodes from a normal cron run (anonymous user) but no responses yet. So, the only approach I can think of is to clone the code found in the node delete function, and eliminate the permission check. I'm hesitant to do this, as it seems odd to be cloning core API code for this purpose.
Comment #4
junyor commentedYes, your work-around worked.
As far as how to solve this, would the deletion API help? See http://drupal.org/node/147723. I know that won't make a difference until Drupal 7, but maybe it could provide some hints.
I just did a quick look through the modules page and a couple modules have similar features:
* http://drupal.org/project/revision_deletion (reimplements node_delete)
* http://drupal.org/project/spam (doesn't work-around this issue, though the 4.7 version seems to work correctly on my site)
* http://drupal.org/project/usernode (deletes node directly)
So, I don't see a solution in any other module unless somehow spam module is working and you just don't know it.
Comment #5
mcurry commentedIn my experience on several sites: Spam module does not delete nodes during cron run. It' can't. It can delete them when you ask it to delete a spam node manually, though, because you are probably logged in as an admin user with 'delete nodes' permissions.
Anyway, I'm working on this problem today, and I may have a solution available soon (reimplementing node_delete code locally, which is stupid, but then, that's what we have to work with.)
Comment #6
mcurry commentedFixed in 5.x-1.5-8 : http://drupal.org/node/164738
Fixed in 4.7.x-1.5-4: http://drupal.org/node/164739
Please let me know if you find any problems with the fixed version.
Comment #7
(not verified) commentedComment #8
mcurry commented