Closed (fixed)
Project:
XML sitemap
Version:
6.x-1.x-dev
Component:
xmlsitemap_node.module
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
8 Jun 2009 at 20:22 UTC
Updated:
26 Jun 2009 at 15:40 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
avpadernoComment #2
Anonymous (not verified) commentedComment #3
Anonymous (not verified) commentedComment #4
dave reidInstead of user_load(array('uid' => 0)) use drupal_anonymous_user(). That's what actually get's loaded into global $user when the page request is anonymous, so we should use that.
Comment #5
Anonymous (not verified) commentedOk, thanks.
Comment #6
Anonymous (not verified) commentedHmm... drupal_anonymous_user() doesn't load up the permissions, i.e. it doesn't give node_access() enough information about the account. Therefore user_load() needs to be used.
Comment #7
dave reidYes it does. It loads the correct user roles, which are used in user_access for permissions.
Comment #8
Anonymous (not verified) commentedHere's what I've come up with that works. I don't like the fact that I've to do the node_load() for the node_access(). Any suggestions?
I had to remove the db_rewrite_sql because it didn't return the correct rows.
Comment #9
avpadernodb_write_sql()doesn't return the correct rows because it verifies the access permission against the actually logged in user, not the anonymous user.node_load()is necessary fornode_access()to properly work because a single module can need the extra fields it adds, to verify if the user has the permission to operate on the passed node.The code seems fine, to me.
Comment #10
Anonymous (not verified) commentedCommitted to CVS.