updated category tree input field name

This commit is contained in:
Shreesh Arora
2024-10-01 12:40:39 +05:30
parent 72e4a2de54
commit 7f034b259d
2 changed files with 2 additions and 7 deletions

View File

@@ -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();

View File

@@ -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']));