Allow listed and searched Wikidata entries to be without descriptions

This commit is contained in:
Joshua Ramon Enslin 2021-07-03 15:18:02 +02:00
parent c56ae6ce66
commit af13f747b7
Signed by: jrenslin
GPG Key ID: 46016F84501B70AE

View File

@ -1558,10 +1558,9 @@ final class NodaWikidataFetcher {
foreach ($wikidata_data['search'] as $result) {
if (empty($result['description'])
or empty($result['label'])
or (isset($result['description']) and $result['description'] == 'Wikipedia disambiguation page')
or (isset($result['description']) and $result['description'] == 'Wikimedia disambiguation page')
if (empty($result['label'])
or (!empty($result['description']) and $result['description'] == 'Wikipedia disambiguation page')
or (!empty($result['description']) and $result['description'] == 'Wikimedia disambiguation page')
) continue;
$cur = [
@ -1610,7 +1609,7 @@ final class NodaWikidataFetcher {
foreach ($wikidata_data as $result) {
if ((isset($result['description']) and $result['description'] == '') or (isset($result['label']) and $result['label'] == '') or !isset($result['label']) or (isset($result['description']) and $result['description'] == 'Wikipedia disambiguation page') or (isset($result['description']) and $result['description'] == 'Wikimedia disambiguation page')) continue;
if ((isset($result['label']) and $result['label'] == '') or !isset($result['label']) or (isset($result['description']) and $result['description'] == 'Wikipedia disambiguation page') or (isset($result['description']) and $result['description'] == 'Wikimedia disambiguation page')) continue;
$output .= '<div><a href="' . $link . 'suchbegriff=' . $searchTerm . '&wikidata_id=' . $result['id'] . '&lang=' . $lang . '">
<h4 class="icons iconsTag">' . $result['id'] . '</h4>';