Skip to content

Commit 8eefbf2

Browse files
authored
Allow to use filter.state for delete button in ListView (#38797)
1 parent 0197d56 commit 8eefbf2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

libraries/src/MVC/View/ListView.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,13 @@ protected function addToolbar()
250250
$bar->appendButton('Custom', $dhtml, 'batch');
251251
}
252252

253-
if ($this->state->get('filter.published') == -2 && $canDo->get('core.delete')) {
253+
if (
254+
$canDo->get('core.delete') &&
255+
(
256+
$this->state->get('filter.state') == -2 ||
257+
$this->state->get('filter.published') == -2
258+
)
259+
) {
254260
ToolbarHelper::deleteList('JGLOBAL_CONFIRM_DELETE', $viewName . '.delete', 'JTOOLBAR_EMPTY_TRASH');
255261
} elseif ($canDo->get('core.edit.state')) {
256262
ToolbarHelper::trash($viewName . '.trash');

0 commit comments

Comments
 (0)