DataObjects/Cms_page.php
authoredward <edward@roojs.com>
Fri, 20 Oct 2017 04:32:28 +0000 (12:32 +0800)
committeredward <edward@roojs.com>
Fri, 20 Oct 2017 04:32:28 +0000 (12:32 +0800)
DataObjects/Cms_page.php

index b47c449..8b38bc8 100644 (file)
@@ -1153,7 +1153,13 @@ class Pman_Cms_DataObjects_Cms_page extends DB_DataObject
             //check the page link is duplicate, then return error
             if(!empty($request['page_link'])){
                 $x = DB_DataObject::factory('cms_page');
-                $x->page_type_id = $this->page_type_id; // make sure they are of the same type..
+                
+                $eid = DB_DataObject::factory('core_enum')->lookup('cms_page_type', 'element');
+                
+                if($this->page_type_id != $eid){
+                    $x->page_type_id = $this->page_type_id; // make sure they are of the same type..
+                }
+                
                 if($x->get('page_link', $request['page_link']) && ($old->page_link != $request['page_link'])){
                     $roo->jerr('Sorry, this page link is existing on the system.');
                 }