Hi,
I guess this classifies as a bug...
Basically, blocked users right now are included in the sitemap. When Google tries to fetch them, it gets a "Permission denied". Google also seems to get obsessive with those URLs. I've had "access denied" in my most popular URLs for some time now...
The fix is simple, and it makes sense: in xmlsitemap_user.module, the query:
db_query("
INSERT INTO {xmlsitemap_user} (uid, last_changed, pid)
SELECT u.uid, u.created, ua.pid FROM {users} u
LEFT JOIN {url_alias} ua ON ua.src = CONCAT('user/', u.uid)
LEFT JOIN {xmlsitemap_user} xu ON xu.uid = u.uid
WHERE u.uid <> 0 AND xu.uid IS NULL
", time());
Should be:
db_query("
INSERT INTO {xmlsitemap_user} (uid, last_changed, pid)
SELECT u.uid, u.created, ua.pid FROM {users} u
LEFT JOIN {url_alias} ua ON ua.src = CONCAT('user/', u.uid)
LEFT JOIN {xmlsitemap_user} xu ON xu.uid = u.uid
WHERE u.uid <> 0 AND xu.uid IS NULL and u.status <> 0
", time());
(NOTE: the only difference is that u.status <> 0)
And the query:
$result = db_query("
SELECT u.uid, xu.last_changed, xu.previously_changed, xu.priority_override, SUM(xur.priority) as priority, ua.dst AS alias
FROM {users} u
LEFT JOIN {users_roles} ur ON ur.uid = u.uid
LEFT JOIN {xmlsitemap_user_role} xur ON xur.rid = ur.rid
LEFT JOIN {xmlsitemap_user} xu ON xu.uid = u.uid
LEFT JOIN {url_alias} ua ON ua.pid = xu.pid
WHERE (xu.priority_override IS NULL OR xu.priority_override >= 0) AND u.uid <> %d AND u.uid > 0
GROUP BY u.uid HAVING MIN(xur.priority) <> -1 OR COUNT(*) = 1 AND %f <> -1
", _xmlsitemap_user_frontpage(), variable_get('xmlsitemap_user_default_priority', 0.1));
Should be:
$result = db_query("
SELECT u.uid, xu.last_changed, xu.previously_changed, xu.priority_override, SUM(xur.priority) as priority, ua.dst AS alias
FROM {users} u
LEFT JOIN {users_roles} ur ON ur.uid = u.uid
LEFT JOIN {xmlsitemap_user_role} xur ON xur.rid = ur.rid
LEFT JOIN {xmlsitemap_user} xu ON xu.uid = u.uid
LEFT JOIN {url_alias} ua ON ua.pid = xu.pid
WHERE (xu.priority_override IS NULL OR xu.priority_override >= 0) AND u.uid <> %d AND u.uid > 0 and u.status <> 0
GROUP BY u.uid HAVING MIN(xur.priority) <> -1 OR COUNT(*) = 1 AND %f <> -1
", _xmlsitemap_user_frontpage(), variable_get('xmlsitemap_user_default_priority', 0.1));
(AGAIN: the only difference is that u.status <> 0 to the WHERE clause)
I can't think of a reason why the sitemap should include blocked users.
Bye!
Merc.
Comments
Comment #1
darren ohFixed in CVS commit 90771.
I did not change the INSERT query because it becomes complicated to make sure the user is inserted when unblocked.
Comment #2
mercmobily commentedHi,
OK thanks a lot Darren!
Merc.
Comment #3
(not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.