mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge remote-tracking branch 'origin/3.1'
This commit is contained in:
commit
ef0f633f46
@ -56,6 +56,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
|
|
||||||
parent::init();
|
parent::init();
|
||||||
|
|
||||||
|
Versioned::reading_stage("Stage");
|
||||||
|
|
||||||
Requirements::css(CMS_DIR . '/css/screen.css');
|
Requirements::css(CMS_DIR . '/css/screen.css');
|
||||||
Requirements::customCSS($this->generatePageIconsCss());
|
Requirements::customCSS($this->generatePageIconsCss());
|
||||||
|
|
||||||
@ -790,6 +792,8 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
public function currentPageID() {
|
public function currentPageID() {
|
||||||
$id = parent::currentPageID();
|
$id = parent::currentPageID();
|
||||||
|
|
||||||
|
$this->extend('updateCurrentPageID', $id);
|
||||||
|
|
||||||
// Fall back to homepage record
|
// Fall back to homepage record
|
||||||
if(!$id) {
|
if(!$id) {
|
||||||
$homepageSegment = RootURLController::get_homepage_link();
|
$homepageSegment = RootURLController::get_homepage_link();
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
class ContentControllerSearchExtensionTest extends SapphireTest {
|
class ContentControllerSearchExtensionTest extends SapphireTest {
|
||||||
|
|
||||||
public function testCustomSearchFormClassesToTest() {
|
public function testCustomSearchFormClassesToTest() {
|
||||||
FulltextSearchable::enable('File');
|
|
||||||
|
|
||||||
$page = new Page();
|
$page = new Page();
|
||||||
$page->URLSegment = 'whatever';
|
$page->URLSegment = 'whatever';
|
||||||
$page->Content = 'oh really?';
|
$page->Content = 'oh really?';
|
||||||
@ -14,4 +12,23 @@ class ContentControllerSearchExtensionTest extends SapphireTest {
|
|||||||
|
|
||||||
if (get_class($form) == 'SearchForm') $this->assertEquals(array('File'), $form->getClassesToSearch());
|
if (get_class($form) == 'SearchForm') $this->assertEquals(array('File'), $form->getClassesToSearch());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function setUpOnce() {
|
||||||
|
parent::setUpOnce();
|
||||||
|
|
||||||
|
FulltextSearchable::enable('File');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FulltextSearchable::enable() leaves behind remains that don't get cleaned up
|
||||||
|
* properly at the end of the test. This becomes apparent when a later test tries to
|
||||||
|
* ALTER TABLE File and add fulltext indexes with the InnoDB table type.
|
||||||
|
*/
|
||||||
|
public function tearDownOnce() {
|
||||||
|
parent::tearDownOnce();
|
||||||
|
|
||||||
|
Config::inst()->update('File', 'create_table_options', array('MySQLDatabase' => 'ENGINE=InnoDB'));
|
||||||
|
File::remove_extension('FulltextSearchable');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user