Merge pull request #341 from tractorcow/pulls/fix-phpcompat-33

BUG Fix regression in #312 in PHP 5.3
This commit is contained in:
Scott Hutchinson 2015-11-23 16:02:34 +13:00
commit 797c8ee45b
2 changed files with 5 additions and 1 deletions

View File

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

View File

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