Code Duplication    Length = 10-10 lines in 2 locations

code/model/VirtualPage.php 1 location

@@ 361-370 (lines=10) @@
358
359
		// "Can be root" validation
360
		$orig = $this->CopyContentFrom();
361
		if(!$orig->stat('can_be_root') && !$this->ParentID) {
362
			$result->error(
363
				_t(
364
					'VirtualPage.PageTypNotAllowedOnRoot', 
365
					'Original page type "{type}" is not allowed on the root level for this virtual page', 
366
					array('type' => $orig->i18n_singular_name())
367
				),
368
				'CAN_BE_ROOT_VIRTUAL'
369
			);
370
		}
371
372
		return $result;
373
	}

code/model/SiteTree.php 1 location

@@ 1622-1631 (lines=10) @@
1619
		}
1620
1621
		// "Can be root" validation
1622
		if(!$this->stat('can_be_root') && !$this->ParentID) {
1623
			$result->error(
1624
				_t(
1625
					'SiteTree.PageTypNotAllowedOnRoot',
1626
					'Page type "{type}" is not allowed on the root level',
1627
					array('type' => $this->i18n_singular_name())
1628
				),
1629
				'CAN_BE_ROOT'
1630
			);
1631
		}
1632
		
1633
		return $result;
1634
	}