public function validatePageTypeRequest(Request $request) { $e = parent::validatePageTypeRequest($request); $page = Page::getByID($request->request->get('cParentID')); if (!is_object($page) || $page->isError()) { $e->add(t('You must choose a valid parent page for pages of this type.')); } return $e; }
public function validatePageTypeRequest(Request $request) { $e = parent::validatePageTypeRequest($request); $type = PageType::getByID($request->request->get('ptID')); if (!$type instanceof PageType) { $e->add(t('You must choose the type of page these page types are published beneath.')); } return $e; }