Update item-uri with guid if given
This commit is contained in:
parent
66f5e7c0f8
commit
98b3058601
1 changed files with 5 additions and 1 deletions
|
@ -42,13 +42,17 @@ class ItemURI
|
|||
DBA::insert('item-uri', $fields, true);
|
||||
}
|
||||
|
||||
$itemuri = DBA::selectFirst('item-uri', ['id'], ['uri' => $uri]);
|
||||
$itemuri = DBA::selectFirst('item-uri', ['id', 'guid'], ['uri' => $uri]);
|
||||
|
||||
if (!DBA::isResult($itemuri)) {
|
||||
// This shouldn't happen
|
||||
return null;
|
||||
}
|
||||
|
||||
if (empty($itemuri['guid']) && !empty($fields['guid'])) {
|
||||
DBA::update('item-uri', ['guid' => $fields['guid']], ['id' => $itemuri['id']]);
|
||||
}
|
||||
|
||||
return $itemuri['id'];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue