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.

Comments

Anonymous’s picture

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.

olio’s picture

StatusFileSize
new658 bytes

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

Anonymous’s picture

Status: Needs work » Needs review

Dave, can you review this please.

dave reid’s picture

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.

dave reid’s picture

Status: Needs work » Closed (won't fix)

D5 is no longer supported.