Download & Extend

Aliases ignored of already existing user entries in xmlsitemap_user table

Project:XML sitemap
Version:5.x-1.7
Component:xmlsitemap_user.module
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (won't fix)

Issue Summary

Hi,
on cron run, the pid of already existing user entries in xmlsitemap_user table won't get updated. As a result, the xml sitemap shows the original path of these entries instead of their alias (e.g. 'user/23' instead of 'users/michael').
The reason for this behavior is the if-clause at the beginning of the function xmlsitemap_user_cron(): The insert and update queries will only be executed if the uid column of an entry is NULL. That is the reason why in the case I described above (-->entry already exists with an uid but a wrong pid), the entries will never be updated with the alias pid.

In the patch attached to this post, I simply removed the last condition of the WHERE clause ("AND xu.uid IS NULL"). I think there are no side effects because the query directly following the if-clause includes this condition as well.

I tested it and the sitemap as well as the xmlsitemap_user table looks fine now.

AttachmentSizeStatusTest resultOperations
xmlsitemap_user.module_cron_query.diff618 bytesIgnored: Check issue status.NoneNone

Comments

#1

Status:patch (to be ported)» needs work

This will cause a full table of users to be reviewed with each execution. The xu.uid IS NULL filter is needed to limit the rows to only those that need created or updated. You need to look for a way to add a OR condition to the query.

#2

Hi earnie,

thanks for your reply.
I changed the query now to "WHERE u.uid <> 0 AND (xu.uid IS NULL OR xu.pid IS NULL)". Now the filter will also include those rows with a NULL value in the pid column. Is this ok?

Thanks,
Oliver

AttachmentSizeStatusTest resultOperations
xmlsitemap_user.module_cron_query_2.diff658 bytesIgnored: Check issue status.NoneNone

#3

Status:needs work» needs review

Dave, can you review this please.

#4

Status:needs review» needs work

I think this needs work. If we have an existing record in {xmlsitemap_user} that does not have an alias (xu.pid is NULL), this is going to pick up this record. But then later we use drupal_write_record() assuming this is always an insert and never an update.

#5

Status:needs work» closed (won't fix)

D5 is no longer supported.

nobody click here