[-] BO : #PSCFV-2568 - CmsController and CmsCategoriesController cannot be called dirrectly
This commit is contained in:
@@ -52,6 +52,15 @@ class AdminCmsCategoriesControllerCore extends AdminController
|
|||||||
'align' => 'center','type' => 'bool', 'orderby' => false
|
'align' => 'center','type' => 'bool', 'orderby' => false
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// The controller can't be call directly
|
||||||
|
// In this case, AdminCmsContentController::getCurrentCMSCategory() is null
|
||||||
|
if (!AdminCmsContentController::getCurrentCMSCategory())
|
||||||
|
{
|
||||||
|
elog('rrrr');
|
||||||
|
$this->redirect_after = '?controller=AdminCmsContent&token='.Tools::getAdminTokenLite('AdminCmsContent');
|
||||||
|
$this->redirect();
|
||||||
|
}
|
||||||
|
|
||||||
$this->cms_category = AdminCmsContentController::getCurrentCMSCategory();
|
$this->cms_category = AdminCmsContentController::getCurrentCMSCategory();
|
||||||
$this->_filter = 'AND `id_parent` = '.(int)$this->cms_category->id;
|
$this->_filter = 'AND `id_parent` = '.(int)$this->cms_category->id;
|
||||||
$this->_select = 'position ';
|
$this->_select = 'position ';
|
||||||
|
|||||||
@@ -35,13 +35,13 @@ class AdminCmsControllerCore extends AdminController
|
|||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->table = 'cms';
|
$this->table = 'cms';
|
||||||
$this->className = 'CMS';
|
$this->className = 'CMS';
|
||||||
$this->lang = true;
|
$this->lang = true;
|
||||||
$this->addRowAction('view');
|
$this->addRowAction('view');
|
||||||
$this->addRowAction('edit');
|
$this->addRowAction('edit');
|
||||||
$this->addRowAction('delete');
|
$this->addRowAction('delete');
|
||||||
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
|
$this->bulk_actions = array('delete' => array('text' => $this->l('Delete selected'), 'confirm' => $this->l('Delete selected items?')));
|
||||||
|
|
||||||
$this->fields_list = array(
|
$this->fields_list = array(
|
||||||
'id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
'id_cms' => array('title' => $this->l('ID'), 'align' => 'center', 'width' => 25),
|
||||||
@@ -51,6 +51,15 @@ class AdminCmsControllerCore extends AdminController
|
|||||||
'active' => array('title' => $this->l('Displayed'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
|
'active' => array('title' => $this->l('Displayed'), 'width' => 25, 'align' => 'center', 'active' => 'status', 'type' => 'bool', 'orderby' => false)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// The controller can't be call directly
|
||||||
|
// In this case, AdminCmsContentController::getCurrentCMSCategory() is null
|
||||||
|
if (!AdminCmsContentController::getCurrentCMSCategory())
|
||||||
|
{
|
||||||
|
elog('rrrr');
|
||||||
|
$this->redirect_after = '?controller=AdminCmsContent&token='.Tools::getAdminTokenLite('AdminCmsContent');
|
||||||
|
$this->redirect();
|
||||||
|
}
|
||||||
|
|
||||||
$this->_category = AdminCmsContentController::getCurrentCMSCategory();
|
$this->_category = AdminCmsContentController::getCurrentCMSCategory();
|
||||||
$this->_join = '
|
$this->_join = '
|
||||||
LEFT JOIN `'._DB_PREFIX_.'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)';
|
LEFT JOIN `'._DB_PREFIX_.'cms_category` c ON (c.`id_cms_category` = a.`id_cms_category`)';
|
||||||
|
|||||||
Reference in New Issue
Block a user