Add logging of synchronization with wikidata

This commit is contained in:
Joshua Ramon Enslin 2021-05-26 17:12:15 +02:00
parent 8a30cf2c2a
commit a4f24e5478
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -422,10 +422,12 @@ final class NodaWikidataFetcher {
SET `persinst_kurzinfo` = ?
WHERE `persinst_id` = ?");
if ($cergebnis->num_rows === 0) exit;
if ($cergebnis->num_rows === 0) {
throw new Exception("There is no actor of ID #" . $persinst_id);
}
$cinfo = $cergebnis->fetch_assoc();
if (!empty($cinfo['persinst_kurzinfo']) and substr($cinfo['persinst_kurzinfo'], 0, 3) != 'GND') {
if (!empty($cinfo['persinst_kurzinfo']) and substr($cinfo['persinst_kurzinfo'], 0, 3) !== 'GND') {
if (isset($_GET['keep'])) {
if (!($_GET['keep']) || $_GET['keep'] === 'replace') {
@ -711,6 +713,8 @@ final class NodaWikidataFetcher {
$this->getWikidataTranslationsForPersinst($data, $persinst_id);
NodaLogEdit::logPersinstEdit($this->_mysqli_noda, $persinst_id, "wikidata-fetcher", $erfasst_von, 'update', 'synchronize');
}
/**
@ -1110,6 +1114,8 @@ final class NodaWikidataFetcher {
$this->getWikidataTranslationsForPlace($data, $onum);
NodaLogEdit::logPlaceEdit($this->_mysqli_noda, $onum, "wikidata-fetcher", $erfasst_von, 'update', 'synchronize');
}
/**
@ -1431,6 +1437,8 @@ final class NodaWikidataFetcher {
// Get translations
if (!empty($data)) $this->getWikidataTranslationsForTag($data, $tag_id);
NodaLogEdit::logTagEdit($this->_mysqli_noda, $tag_id, "wikidata-fetcher", $erfasst_von, 'update', 'synchronize');
}
/**