ViewPhotoAlbum: don't include empty $by in page links

This commit is contained in:
Aaron van Geffen 2024-01-15 13:43:54 +01:00
parent c0dd2cbd49
commit 30bc0bb884
1 changed files with 2 additions and 2 deletions

View File

@ -60,7 +60,7 @@ class ViewPhotoAlbum extends HTMLController
'label' => $contributor['first_name'],
'caption' => sprintf('By %s (%s photos)',
$contributor['first_name'], $contributor['num_assets']),
'link' => $tag->getUrl() . '/?by=' . $contributor['slug'],
'link' => $tag->getUrl() . '?by=' . $contributor['slug'],
];
}
}
@ -119,7 +119,7 @@ class ViewPhotoAlbum extends HTMLController
'items_per_page' => self::PER_PAGE,
'start' => ($current_page - 1) * self::PER_PAGE,
'base_url' => $tag->getUrl(),
'page_slug' => 'page/%PAGE%/' . (isset($active_filter) ? '?by=' . $active_filter : ''),
'page_slug' => 'page/%PAGE%/' . (!empty($active_filter) ? '?by=' . $active_filter : ''),
'index_class' => 'pagination-lg justify-content-around justify-content-lg-center',
]);
$this->page->adopt(new PageIndexWidget($index));