Fix bug in preventing impossible noda relations

This commit is contained in:
Joshua Ramon Enslin 2021-12-12 03:36:23 +01:00
parent 340bfac96c
commit 93cd09ed23
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -765,7 +765,7 @@ final class NodaWikidataFetcher {
"wikidata" => $wikidata_id,
];
foreach (self::P_IDS_NODA_TAGS as $vocabName => $pId) {
if (!isset(MDNodaRepositoriesSet::REPOSITORIES_ACTOR[$vocabName])) continue;
if (!in_array($vocabName, MDNodaRepositoriesSet::REPOSITORIES_ACTOR, true)) continue;
if ($vocabName === 'lcsh') continue;
if (isset($data['claims'][$pId])) $nodaLinks[$vocabName] = $data['claims'][$pId][0]['mainsnak']['datavalue']['value'];
}
@ -1109,7 +1109,7 @@ final class NodaWikidataFetcher {
"wikidata" => $wikidata_id,
];
foreach (self::P_IDS_NODA_TAGS as $vocabName => $pId) {
if (!isset(MDNodaRepositoriesSet::REPOSITORIES_PLACE[$vocabName])) continue;
if (!in_array($vocabName, MDNodaRepositoriesSet::REPOSITORIES_PLACE, true)) continue;
if ($vocabName === 'lcsh') continue;
if (isset($data['claims'][$pId])) $nodaLinks[$vocabName] = $data['claims'][$pId][0]['mainsnak']['datavalue']['value'];
}
@ -1498,7 +1498,7 @@ final class NodaWikidataFetcher {
"wikidata" => $wikidata_id,
];
foreach (self::P_IDS_NODA_TAGS as $vocabName => $pId) {
if (!isset(MDNodaRepositoriesSet::REPOSITORIES_TAG[$vocabName])) continue;
if (!in_array($vocabName, MDNodaRepositoriesSet::REPOSITORIES_TAG, true)) continue;
if ($vocabName === 'loc') continue;
if (isset($data['claims'][$pId])) $nodaLinks[$vocabName] = $data['claims'][$pId][0]['mainsnak']['datavalue']['value'];
}