Merge pull request #8952 from creative-commoners/pulls/4.4/hide-better-buttons-without-paginator

FIX Don't add "better buttons" previous and next without a paginator
This commit is contained in:
Robbie Averill 2019-05-01 16:07:31 +12:00 committed by GitHub
commit 6b8f0eae30
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -286,8 +286,9 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler
/** @var GridFieldDetailForm $component */
$component = $this->gridField->getConfig()->getComponentByType(GridFieldDetailForm::class);
$paginator = $this->getGridField()->getConfig()->getComponentByType(GridFieldPaginator::class);
$gridState = $this->getRequest()->requestVar('gridState');
if ($component && $component->getShowPagination()) {
if ($component && $paginator && $component->getShowPagination()) {
$previousAndNextGroup->push(FormAction::create('doPrevious')
->setUseButtonTag(true)
->setAttribute('data-grid-state', $gridState)