From f7c1be7ac1aa2268a8a25d897fdf05959fbba8f8 Mon Sep 17 00:00:00 2001 From: Rafael Marins de Sousa Date: Tue, 28 May 2019 12:28:00 +1200 Subject: [PATCH] Including canCreate in if statement so that button gets removed if user isn't to be able to create new records --- src/Forms/GridField/GridFieldDetailForm_ItemRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php index a5bcebb52..4b58032e4 100644 --- a/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php +++ b/src/Forms/GridField/GridFieldDetailForm_ItemRequest.php @@ -323,7 +323,7 @@ class GridFieldDetailForm_ItemRequest extends RequestHandler $rightGroup->push($previousAndNextGroup); - if ($component && $component->getShowAdd()) { + if ($component && $component->getShowAdd() && $this->record->canCreate()) { $rightGroup->push( LiteralField::create( 'new-record',