Merge pull request #1959 from creative-commoners/pulls/4.0/fix-client-config-merging

FIX Ensure client config merging includes existing parent "form" attributes
This commit is contained in:
Damian Mooyman 2017-09-15 16:01:56 +12:00 committed by GitHub
commit 1a42b60c90

View File

@ -10,6 +10,7 @@ use SilverStripe\Control\Controller;
use SilverStripe\Control\HTTPRequest; use SilverStripe\Control\HTTPRequest;
use SilverStripe\Control\HTTPResponse; use SilverStripe\Control\HTTPResponse;
use SilverStripe\Forms\Form; use SilverStripe\Forms\Form;
use SilverStripe\ORM\ArrayLib;
use SilverStripe\ORM\FieldType\DBHTMLText; use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\ORM\ValidationResult; use SilverStripe\ORM\ValidationResult;
@ -33,7 +34,7 @@ class CMSPageEditController extends CMSMain
public function getClientConfig() public function getClientConfig()
{ {
return array_merge(parent::getClientConfig(), [ return ArrayLib::array_merge_recursive(parent::getClientConfig(), [
'form' => [ 'form' => [
'AddToCampaignForm' => [ 'AddToCampaignForm' => [
'schemaUrl' => $this->Link('schema/AddToCampaignForm') 'schemaUrl' => $this->Link('schema/AddToCampaignForm')