//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;
- // if it's a page or blog..- then no dupes...
- // otherwise dupes are allowed.. FIXME
+ $eid = DB_DataObject::factory('core_enum')->lookup('cms_page_type', 'element');
- if(!empty($request['page_link']) && $x->get('page_link', $request['page_link'])){
- $roo->jerr('Sorry, this page link exists already.');
+ if($this->page_type_id != $eid){
+
+ $x = DB_DataObject::factory('cms_page');
+ $x->page_type_id = $this->page_type_id;
+
+ if(!empty($request['page_link']) && $x->get('page_link', $request['page_link'])){
+ $roo->jerr('Sorry, this page link exists already.');
+ }
}
+
}
}