Skip to content

Commit f055c9f

Browse files
authored
Merge pull request #233 from dotkernel/develop
Exclude unused categories from sitemap
2 parents a83fe0e + 80782f1 commit f055c9f

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎src/Blog/src/Repository/CategoryRepository.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ public function getCategoriesWithPublishedPosts(): array
4242
->from(Category::class, 'categories');
4343

4444
$qb->where($qb->expr()->in('categories.id', $publishedCategoryIds->getDQL()))
45-
->setParameter('published', PostStatusEnum::Published);
45+
->andWhere('categories.isVisible = :visible')
46+
->setParameter('published', PostStatusEnum::Published)
47+
->setParameter('visible', true);
4648

4749
return $qb->getQuery()->getResult();
4850
}

0 commit comments

Comments
 (0)