getHasButtons() returns true when all buttons are hidden

softforge

Member
I have set "Show add" to no in the list parameters but still allowed users permission to add records. When there are no other buttons, you still get the ul for the buttons appearing with no li buttons and this creates a line above the list.

The reason for this is the following line in components/com_fabrik/models/list.php which only checks for the add permission, not whether you want to display the button:

Code:
        if ($this->canAdd() || $this->getShowFilters() || $this->getAdvancedSearchLink() || $this->canGroupBy() || $this->canCSVExport()
                || $this->canCSVImport() || $params->get('rss') || $params->get('pdf') || $this->canEmpty())
        {

I have fixed the issue by changing it to this:

Code:
        if (($this->canAdd() && $params->get('show-table-add')) || $this->getShowFilters() || $this->getAdvancedSearchLink() || $this->canGroupBy() || $this->canCSVExport()
                || $this->canCSVImport() || $params->get('rss') || $params->get('pdf') || $this->canEmpty())
        {

This simple fix makes the getHasButtons() function work correctly when hiding the add button.
 
We are in need of some funding.
More details.

Thank you.

Members online

No members online now.
Back
Top