Cannot disable list view delete button without disabling action dropdown #7203
Labels
Priority:Important
Issues & PRs that are important; broken functions, errors - there are workarounds
Type:Bug
Bugs within the core SuiteCRM codebase
Issue
In a list view I want to hide the delete button from the action dropdown menu. In
ListViewDisplay.php
there is a field calleddelete
that is accessed which can be used to check if the delete button is built or not. There are two blocks of code that deal with this field in thebuildActionsLink()
function around lines 322 and 378. The first block at line 322 will either build the delete button and make it the top dropdown button or will build the action button and make it the top dropdown.Expected Behavior
I would like to hide the delete button without also hiding the action button
Actual Behavior
If you mark the delete button as false the action button is hidden as well
Possible Fix
I'm not sure what the purpose of this is in the first place. The dropdown menu id starts with
delete_listview_
and I don't understand why this action menu can only be built with a delete button present.I modified the if statement to add an else clause that just adds the action button as a quick fix
else{ $menuItems[] = $this->buildBulkActionButton($location); }
Steps to Reproduce
$this->lv->deleted = false;
after the list view has been createdbuildActionsLink()
inListViewDisplay.php
the action button creation will be skipped and not displayed on the list viewContext
Your Environment
The text was updated successfully, but these errors were encountered: