Browse Source

Update item-uri with guid if given

pull/8520/head
Michael 2 years ago
parent
commit
98b3058601
  1. 6
      src/Model/ItemURI.php

6
src/Model/ItemURI.php

@ -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…
Cancel
Save