Skip to content

Commit

Permalink
fixing code analysis: replacing deprecated methods
Browse files Browse the repository at this point in the history
  • Loading branch information
wernerkrauss committed Jun 1, 2017
1 parent 4fc13b1 commit abe1ac9
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion code/extensions/ControllerSubsites.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function controllerAugmentInit()
{
if ($subsite = Subsite::currentSubsite()) {
if ($theme = $subsite->Theme) {
SSViewer::set_theme($theme);
SSViewer::set_themes([$theme, SSViewer::DEFAULT_THEME]);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion code/model/Subsite.php
Original file line number Diff line number Diff line change
Expand Up @@ -936,7 +936,7 @@ public function duplicate($doWrite = true)
$childClone = $child->duplicateToSubsite($duplicate, false);
$childClone->ParentID = $destParentID;
$childClone->writeToStage('Stage');
$childClone->publish('Stage', 'Live');
$childClone->copyVersionToStage('Stage', 'Live');

self::changeSubsite($this->ID); //Change Back to this subsite

Expand Down
2 changes: 1 addition & 1 deletion code/tasks/SubsiteCopyPagesTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function run($request)

$childClone->ParentID = $destParentID;
$childClone->writeToStage('Stage');
$childClone->publish('Stage', 'Live');
$childClone->copyVersionToStage('Stage', 'Live');
array_push($stack, array($child->ID, $childClone->ID));

$this->log(sprintf('Copied "%s" (#%d, %s)', $child->Title, $child->ID, $child->Link()));
Expand Down
2 changes: 1 addition & 1 deletion tests/behat/features/bootstrap/Context/FeatureContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public function __construct(array $parameters)
foreach (ClassInfo::subclassesFor(SiteTree::class) as $id => $class) {
$blueprint = Injector::inst()->create(FixtureBlueprint::class, $class);
$blueprint->addCallback('afterCreate', function ($obj, $identifier, &$data, &$fixtures) {
$obj->publish('Stage', 'Live');
$obj->copyVersionToStage('Stage', 'Live');
});
$factory->define($class, $blueprint);
}
Expand Down
6 changes: 3 additions & 3 deletions tests/php/SiteTreeSubsitesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ public function testPagesInDifferentSubsitesCanShareURLSegment()
$pageMain = new SiteTree();
$pageMain->URLSegment = 'testpage';
$pageMain->write();
$pageMain->publish('Stage', 'Live');
$pageMain->copyVersionToStage('Stage', 'Live');

$pageMainOther = new SiteTree();
$pageMainOther->URLSegment = 'testpage';
$pageMainOther->write();
$pageMainOther->publish('Stage', 'Live');
$pageMainOther->copyVersionToStage('Stage', 'Live');

$this->assertNotEquals($pageMain->URLSegment, $pageMainOther->URLSegment,
'Pages in same subsite cant share the same URL'
Expand All @@ -58,7 +58,7 @@ public function testPagesInDifferentSubsitesCanShareURLSegment()
$pageSubsite1 = new SiteTree();
$pageSubsite1->URLSegment = 'testpage';
$pageSubsite1->write();
$pageSubsite1->publish('Stage', 'Live');
$pageSubsite1->copyVersionToStage('Stage', 'Live');

$this->assertEquals($pageMain->URLSegment, $pageSubsite1->URLSegment,
'Pages in different subsites can share the same URL'
Expand Down
2 changes: 1 addition & 1 deletion tests/php/SubsiteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public function testSubsiteCreation()
$totalPages = $pages->count();
foreach ($pages as $page) {
$this->assertEquals($template->ID, $page->SubsiteID);
$page->publish('Stage', 'Live');
$page->copyVersionToStage('Stage', 'Live');
}

// Create a new site
Expand Down
6 changes: 3 additions & 3 deletions tests/php/SubsitesVirtualPageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function testPublishedSubsiteVirtualPagesUpdateIfTargetPageUpdates()
$p->Content = 'Content';
$p->Title = 'Title';
$p->writeToStage('Stage');
$p->publish('Stage', 'Live');
$p->copyVersionToStage('Stage', 'Live');
$this->assertTrue($p->ExistsOnLive);

// change to subsite
Expand All @@ -185,7 +185,7 @@ public function testPublishedSubsiteVirtualPagesUpdateIfTargetPageUpdates()
$svp->CopyContentFromID = $p->ID;
$svp->write();
$svp->writeToStage('Stage');
$svp->publish('Stage', 'Live');
$svp->copyVersionToStage('Stage', 'Live');
$this->assertEquals($svp->SubsiteID, $subsite->ID);
$this->assertTrue($svp->ExistsOnLive);

Expand All @@ -196,7 +196,7 @@ public function testPublishedSubsiteVirtualPagesUpdateIfTargetPageUpdates()
$p->Title = 'New Title';
// "save & publish"
$p->writeToStage('Stage');
$p->publish('Stage', 'Live');
$p->copyVersionToStage('Stage', 'Live');
$this->assertNotEquals($p->SubsiteID, $subsite->ID);

// reload SVP from database
Expand Down

0 comments on commit abe1ac9

Please sign in to comment.