Commit 66abf6df authored by Dave Reid's avatar Dave Reid
Browse files

by Dave Reid: Prevent fatal errors when xmlsitemap_user_user_presave() gets a...

by Dave Reid: Prevent fatal errors when xmlsitemap_user_user_presave() gets a new user since $account->uid is undefined.
parent cb472db4
......@@ -46,12 +46,14 @@ function xmlsitemap_user_xmlsitemap_process_user_links(array $uids) {
* Implements hook_user_presave().
*/
function xmlsitemap_user_user_presave(&$edit, $account, $category) {
$link = xmlsitemap_user_create_link($account);
if (isset($edit['xmlsitemap'])) {
$link = $edit['xmlsitemap'] + $link;
unset($edit['xmlsitemap']);
if (!empty($account->uid)) {
$link = xmlsitemap_user_create_link($account);
if (isset($edit['xmlsitemap'])) {
$link = $edit['xmlsitemap'] + $link;
unset($edit['xmlsitemap']);
}
xmlsitemap_link_save($link);
}
xmlsitemap_link_save($link);
}
/**
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment