Merge pull request #9019 from rafaeldsousa/pull/include-cancreate-check-gridfield-rightgroupfield

Including canCreate in if statement so that button gets removed if us…
This commit is contained in:
Robbie Averill 2019-06-10 09:59:45 +12:00 committed by GitHub
commit 179a982f45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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',