Skip to content

Commit

Permalink
Only return items with non empty slugs fixes: #26
Browse files Browse the repository at this point in the history
  • Loading branch information
jadwigo authored Mar 11, 2019
1 parent 422cc1b commit 06e0cb8
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Twig/TaxonomyListExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,15 +202,19 @@ protected function getFullTaxonomy($name = null, $taxonomy = null, $params = nul
} else {
$row['weightclass'] = 'xl';
}

$populatedrows[$row['slug']] = $row;

if ($row['slug']) {
$populatedrows[$row['slug']] = $row;
}
}
$named['options'] = $populatedrows;
} elseif ($rows) {
// return all rows - so add the count to all existing rows
// weight is useless here
foreach ($rows as $row) {
$named['options'][$row['slug']] = $row;
if ($row['slug']) {
$named['options'][$row['slug']] = $row;
}
}
}

Expand Down

0 comments on commit 06e0cb8

Please sign in to comment.