Skip to content
Browse files

MINOR Fixed merge errors

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@92845 467b73ca-7a2a-4603-9d3b-597d59a354a9
  • Loading branch information...
1 parent 0df7de0 commit 32d6342affcf7481ca8dc5a884788cb0e8ae3663 @chillu chillu committed
Showing with 24 additions and 38 deletions.
  1. +17 −32 code/LeftAndMain.php
  2. +4 −3 tests/CMSMainTest.php
  3. +3 −3 tests/SecurityAdminTest.php
View
49 code/LeftAndMain.php
@@ -635,41 +635,27 @@ public function ajaxupdateparent($request) {
$node = DataObject::get_by_id($this->stat('tree_class'), $id);
if($node){
if($node && !$node->canEdit()) return Security::permissionFailure($this);
-
+
$node->ParentID = $parentID;
- $node->Status = "Saved (update)";
$node->write();
-
- if(is_numeric($_REQUEST['CurrentlyOpenPageID'])) {
- $currentPage = DataObject::get_by_id($this->stat('tree_class'), $_REQUEST['CurrentlyOpenPageID']);
- if($currentPage) {
- $cleanupJS = $currentPage->cmsCleanup_parentChanged();
- }
- }
-
- $node = DataObject::get_by_id($this->stat('tree_class'), $id);
- if($node){
- if($node && !$node->canEdit()) return Security::permissionFailure($this);
-
- $node->ParentID = $parentID;
- $node->write();
- $statusUpdates['modified'][$node->ID] = array(
- 'TreeTitle'=>$node->TreeTitle
- );
+ $statusUpdates['modified'][$node->ID] = array(
+ 'TreeTitle'=>$node->TreeTitle
+ );
- $this->response->addHeader(
- 'X-Status',
- _t('LeftAndMain.SAVED','saved')
- );
- }else{
- $this->response->setStatusCode(
- 500,
- _t(
- 'LeftAndMain.PLEASESAVE',
- "Please Save Page: This page could not be upated because it hasn't been saved yet."
- )
- );
+ $this->response->addHeader(
+ 'X-Status',
+ _t('LeftAndMain.SAVED','saved')
+ );
+ }else{
+ $this->response->setStatusCode(
+ 500,
+ _t(
+ 'LeftAndMain.PLEASESAVE',
+ "Please Save Page: This page could not be upated because it hasn't been saved yet."
+ )
+ );
+ }
}
return Convert::raw2json($statusUpdates);
@@ -870,7 +856,6 @@ function AddForm() {
new FormAction('doAdd', _t('AssetAdmin_left.ss.GO','Go'))
)
);
- $form->setValidator(null);
$form->addExtraClass('actionparams');
return $form;
View
7 tests/CMSMainTest.php
@@ -39,11 +39,12 @@ function testPublish() {
sprintf(_t('CMSMain.PUBPAGES',"Done: Published %d pages"), 5),
$response->getBody()
);
-
+
$response = Director::test("admin/cms/batchactions/publish", array('csvIDs' => '1,2', 'ajax' => 1), $this->session());
- $this->assertContains('setNodeTitle(1, \'Page 1\');', $response->getBody());
- $this->assertContains('setNodeTitle(2, \'Page 2\');', $response->getBody());
+ $responseData = Convert::json2array($response->getBody());
+ $this->assertTrue(property_exists($responseData['modified'], '1'));
+ $this->assertTrue(property_exists($responseData['modified'], '2'));
$this->session()->clear('loggedInAs');
View
6 tests/SecurityAdminTest.php
@@ -10,11 +10,11 @@ function testGroupExport() {
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
/* First, open the applicable group */
- $this->get('admin/security/getitem?ID=' . $this->idFromFixture('Group','admin'));
+ $this->get('admin/security/show/' . $this->idFromFixture('Group','admin'));
$this->assertRegExp('/<input[^>]+id="Form_EditForm_Title"[^>]+value="Administrators"[^>]*>/',$this->content());
/* Then load the export page */
- $this->get('admin/security//EditForm/field/Members/export');
+ $this->get('admin/security/EditForm/field/Members/export');
$lines = preg_split('/\n/', $this->content());
$this->assertEquals(count($lines), 3, "Export with members has one content row");
@@ -25,7 +25,7 @@ function testEmptyGroupExport() {
$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'admin'));
/* First, open the applicable group */
- $this->get('admin/security/getitem?ID=' . $this->idFromFixture('Group','empty'));
+ $this->get('admin/security/show/' . $this->idFromFixture('Group','empty'));
$this->assertRegExp('/<input[^>]+id="Form_EditForm_Title"[^>]+value="Empty Group"[^>]*>/',$this->content());
/* Then load the export page */

0 comments on commit 32d6342

Please sign in to comment.
Something went wrong with that request. Please try again.