From fae19c16b54f077bbd7665a50df516d290faa07e Mon Sep 17 00:00:00 2001 From: Jonathon Menz Date: Mon, 25 Mar 2019 15:49:38 -0700 Subject: [PATCH 1/2] FIX has_one File form scaffolding Only allow selection of a single file when scaffolding has_one File relationship (fixes #8862) --- src/ORM/FieldType/DBForeignKey.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ORM/FieldType/DBForeignKey.php b/src/ORM/FieldType/DBForeignKey.php index c01a945be..ad5e39b09 100644 --- a/src/ORM/FieldType/DBForeignKey.php +++ b/src/ORM/FieldType/DBForeignKey.php @@ -55,6 +55,9 @@ class DBForeignKey extends DBInt if ($hasOneSingleton instanceof Image) { $field->setAllowedFileCategories('image/supported'); } + if ($field->hasMethod('setAllowedMaxFileNumber')) { + $field->setAllowedMaxFileNumber(1); + } return $field; } From 8b4b54f264aab1e8b2cb23aa14fa442803f21943 Mon Sep 17 00:00:00 2001 From: Robbie Averill Date: Fri, 5 Apr 2019 16:29:24 +1300 Subject: [PATCH 2/2] PHPCS linting error on indentation --- src/Forms/GridField/GridFieldLevelup.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Forms/GridField/GridFieldLevelup.php b/src/Forms/GridField/GridFieldLevelup.php index d16d41a88..5d6c8742d 100644 --- a/src/Forms/GridField/GridFieldLevelup.php +++ b/src/Forms/GridField/GridFieldLevelup.php @@ -86,7 +86,7 @@ class GridFieldLevelup implements GridField_HTMLProvider )); $template = SSViewer::get_templates_by_class($this, '', __CLASS__); - return array( + return array( 'before' => $forTemplate->renderWith($template), ); }