BUG Fix regression in #312 in PHP 5.3

This commit is contained in:
Damian Mooyman 2015-11-23 15:43:27 +13:00
parent a4c6e5abb6
commit 5282ad84f9
2 changed files with 5 additions and 1 deletions

View File

@ -216,7 +216,7 @@ class BlogPost extends Page
$authorField = ListboxField::create( $authorField = ListboxField::create(
'Authors', 'Authors',
_t('BlogPost.Authors', 'Authors'), _t('BlogPost.Authors', 'Authors'),
$this->getCandidateAuthors()->map()->toArray() $self->getCandidateAuthors()->map()->toArray()
)->setMultiple(true); )->setMultiple(true);
$authorNames = TextField::create( $authorNames = TextField::create(

View File

@ -78,5 +78,9 @@ class BlogPostTest extends SapphireTest
Config::inst()->update('BlogPost', 'restrict_authors_to_group', 'BlogUsers'); Config::inst()->update('BlogPost', 'restrict_authors_to_group', 'BlogUsers');
$this->assertEquals(3, $blogpost->getCandidateAuthors()->count()); $this->assertEquals(3, $blogpost->getCandidateAuthors()->count());
// Test cms field is generated
$fields = $blogpost->getCMSFields();
$this->assertNotEmpty($fields->dataFieldByName('Authors'));
} }
} }