Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot disable list view delete button without disabling action dropdown #7203

Open
wiatrp opened this issue Apr 17, 2019 · 0 comments
Open
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type:Bug Bugs within the core SuiteCRM codebase

Comments

@wiatrp
Copy link

wiatrp commented Apr 17, 2019

Issue

In a list view I want to hide the delete button from the action dropdown menu. In ListViewDisplay.php there is a field called delete 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 the buildActionsLink() 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

  1. Create custom view.list.php for any module
  2. In the preDisplay() function add $this->lv->deleted = false; after the list view has been created
  3. Once the code reaches buildActionsLink() in ListViewDisplay.php the action button creation will be skipped and not displayed on the list view

Context

Your Environment

  • SuiteCRM Version used: 7.10.2
  • Browser name and version (e.g. Chrome Version 51.0.2704.63 (64-bit)):
  • Environment name and version (e.g. MySQL, PHP 7):
  • Operating System and version (e.g Ubuntu 16.04):
@cameronblaikie cameronblaikie added Type:Bug Bugs within the core SuiteCRM codebase Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds labels May 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority:Important Issues & PRs that are important; broken functions, errors - there are workarounds Type:Bug Bugs within the core SuiteCRM codebase
Projects
None yet
Development

No branches or pull requests

2 participants