Closed (fixed)
Project:
SimpleFeed
Version:
5.x-2.0
Component:
Code
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Feb 2008 at 01:05 UTC
Updated:
25 Jun 2008 at 06:02 UTC
I am using simeplefeed and everything works fine except that the items never expire. The cron job is set up correctly as the feed is refreshed but whatever time I set for the feed item expiration never changes and nothing expires.
Comments
Comment #1
irakli commentedSimpleFeed uses node_delete($nid) function to expire feeds and nodes associated with them. node_delete checks node_access('delete', $node) on current user to see if current user should be allowed to delete a node.
Since all this goodness runs through cron "current user" is anonymous. Therefore, one of two:
1) Drupal core needs to allow to pass $userid, rather than always assuming current user or allow crons to run as "admin" (security risk) - very less probable Drupal core team will make any changes in foreseeable future.
2) This is a bug of SimpleFeed and the author needs to fix it. - please?
3) You can grant anonymous user node-delete permissions. It is a security risk, but as far as you don't give 'em node/edit permissions, you may be fine.
Any other thoughts?
Comment #2
irakli commentedComment #3
code rader commentedAfter looking at this bug report I realized that I could manually force these to expire if I ran cron while logged in as the admin.
But it still didn't work.
So I reworked the sql in simplefeed_item_expire to be "SELECT DISTINCT nr.nid FROM {simplefeed_feed_item} s JOIN {node_revisions} nr ON s.vid = nr.vid JOIN {node} n ON n.nid = nr.nid WHERE s.expires <> 0 AND s.expires <= (%d-
n.created)"
It was taking the node_revision.timestamp time, but that isn't the same as the node.created time. With that revision it now deletes them. This doesn't fix the bug because we still have the permission issue I think. Actually it might work now. I'll have to wait and see after a few days.
Comment #4
Leeteq commentedSubscribing.
Comment #5
m3avrck commentedFixed: http://drupal.org/cvs?commit=120707
Comment #6
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.