updated category tree input field name
This commit is contained in:
@@ -71,7 +71,6 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
$categoryId = (int)$category['id_category'];
|
||||
$tree[$categoryId] = $category;
|
||||
$tree[$categoryId]['value'] = $category['id_category'];
|
||||
$tree[$categoryId]['input_name'] = 'categoryBox';
|
||||
|
||||
if (Category::hasChildren($categoryId, $this->getLang(), false, $this->getShop()->id)) {
|
||||
$categoryChildren = Category::getChildren(
|
||||
@@ -434,13 +433,13 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
|
||||
$html = '';
|
||||
foreach ($data as $item) {
|
||||
$item['input_name'] = $this->getInputName();
|
||||
if (array_key_exists('children', $item)
|
||||
&& !empty($item['children'])) {
|
||||
$html .= $this->getContext()->smarty->createTemplate(
|
||||
$this->getTemplateFile($this->getNodeFolderTemplate()),
|
||||
$this->getContext()->smarty
|
||||
)->assign(array(
|
||||
'input_name' => $this->getInputName(),
|
||||
'input_id' => $this->getInputId(),
|
||||
'children' => $this->renderNodes($item['children']),
|
||||
'node' => $item
|
||||
@@ -450,7 +449,6 @@ class HelperTreeCategoriesCore extends TreeCore
|
||||
$this->getTemplateFile($this->getNodeItemTemplate()),
|
||||
$this->getContext()->smarty
|
||||
)->assign(array(
|
||||
'input_name' => $this->getInputName(),
|
||||
'input_id' => $this->getInputId(),
|
||||
'node' => $item
|
||||
))->fetch();
|
||||
|
||||
@@ -720,13 +720,11 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
public function processAdd()
|
||||
{
|
||||
$id_category = (int)Tools::getValue('id_category');
|
||||
$id_parent = (int)Tools::getValue('categoryBox');
|
||||
$id_parent = (int)Tools::getValue('id_parent');
|
||||
// if true, we are in a root category creation
|
||||
if (!$id_parent) {
|
||||
$_POST['is_root_category'] = $_POST['level_depth'] = 1;
|
||||
$_POST['id_parent'] = $id_parent = (int)Configuration::get('PS_ROOT_CATEGORY');
|
||||
} else {
|
||||
$_POST['id_parent'] = $id_parent;
|
||||
}
|
||||
|
||||
if ($id_category) {
|
||||
@@ -759,7 +757,6 @@ class AdminCategoriesControllerCore extends AdminController
|
||||
// @todo remove this after adding link_rewrite form option
|
||||
// currently have removed link_rewrite as it is currently not required
|
||||
// so adding link_rewrite in $_POST
|
||||
$_POST['id_parent'] = $id_parent = (int)Tools::getValue('categoryBox');
|
||||
if (!Validate::isLoadedObject($this->object)) {
|
||||
foreach (Language::getLanguages(true) as $lang) {
|
||||
$_POST['link_rewrite_'.$lang['id_lang']] = Tools::link_rewrite(Tools::getValue('name_'.$lang['id_lang']));
|
||||
|
||||
Reference in New Issue
Block a user