Allow to use filter.state for delete button in ListView (#38797)

This commit is contained in:
Harald Leithner 2024-03-22 13:02:57 +01:00 committed by GitHub
parent 0197d56ef1
commit 8eefbf2375
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 1 deletions

View File

@ -250,7 +250,13 @@ class ListView extends HtmlView
$bar->appendButton('Custom', $dhtml, 'batch');
}
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
if (
$canDo->get('core.delete') &&
(
$this->state->get('filter.state') == -2 ||
$this->state->get('filter.published') == -2
)
) {
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', $viewName . '.delete', 'JTOOLBAR_EMPTY_TRASH');
} elseif ($canDo->get('core.edit.state')) {
ToolbarHelper::trash($viewName . '.trash');