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

irakli’s picture

SimpleFeed 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?

irakli’s picture

Category: support » bug
Priority: Normal » Critical
code rader’s picture

Version: 5.x-1.x-dev » 5.x-2.0
Status: Active » Needs review

After 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.

Leeteq’s picture

Subscribing.

m3avrck’s picture

Status: Needs review » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.