From 9a4b2ff6a5bcb8401ae161d90b8c76bbf8a7ccb8 Mon Sep 17 00:00:00 2001 From: mgielecinski Date: Thu, 11 Jun 2026 15:11:49 +0200 Subject: [PATCH 1/5] Fix edit and delete filter template link without token --- ps_facetedsearch.php | 1 + views/templates/admin/manage.tpl | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ps_facetedsearch.php b/ps_facetedsearch.php index 5cf2cd86f..744035082 100644 --- a/ps_facetedsearch.php +++ b/ps_facetedsearch.php @@ -809,6 +809,7 @@ public function renderAdminMain() 'filter_by_default_category' => (bool) Configuration::get('PS_LAYERED_FILTER_BY_DEFAULT_CATEGORY'), 'use_jquery_ui_slider' => (bool) Configuration::get('PS_USE_JQUERY_UI_SLIDER'), 'default_category_template' => Configuration::get('PS_LAYERED_DEFAULT_CATEGORY_TEMPLATE'), + 'link' => $this->context->link ]); return $this->display(__FILE__, 'views/templates/admin/manage.tpl'); diff --git a/views/templates/admin/manage.tpl b/views/templates/admin/manage.tpl index 10129f7ed..63766da5b 100644 --- a/views/templates/admin/manage.tpl +++ b/views/templates/admin/manage.tpl @@ -75,7 +75,13 @@ {if empty($limit_warning)}
- + {l s='Edit' d='Admin.Actions'}
From cd61a76b4443f321f7625a3a7612092e1c77219e Mon Sep 17 00:00:00 2001 From: mgielecinski Date: Thu, 11 Jun 2026 21:07:45 +0200 Subject: [PATCH 3/5] fix CS --- ps_facetedsearch.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ps_facetedsearch.php b/ps_facetedsearch.php index 744035082..8565b5648 100644 --- a/ps_facetedsearch.php +++ b/ps_facetedsearch.php @@ -809,7 +809,7 @@ public function renderAdminMain() 'filter_by_default_category' => (bool) Configuration::get('PS_LAYERED_FILTER_BY_DEFAULT_CATEGORY'), 'use_jquery_ui_slider' => (bool) Configuration::get('PS_USE_JQUERY_UI_SLIDER'), 'default_category_template' => Configuration::get('PS_LAYERED_DEFAULT_CATEGORY_TEMPLATE'), - 'link' => $this->context->link + 'link' => $this->context->link, ]); return $this->display(__FILE__, 'views/templates/admin/manage.tpl'); From 6edc8ae90aac86b71198304e96566a02a17fde6d Mon Sep 17 00:00:00 2001 From: mgielecinski Date: Fri, 19 Jun 2026 13:04:25 +0200 Subject: [PATCH 4/5] Prepare links in php --- ps_facetedsearch.php | 14 +++++++++++++- views/templates/admin/manage.tpl | 16 +++------------- 2 files changed, 16 insertions(+), 14 deletions(-) diff --git a/ps_facetedsearch.php b/ps_facetedsearch.php index 8565b5648..d45c7fe80 100644 --- a/ps_facetedsearch.php +++ b/ps_facetedsearch.php @@ -809,7 +809,7 @@ public function renderAdminMain() 'filter_by_default_category' => (bool) Configuration::get('PS_LAYERED_FILTER_BY_DEFAULT_CATEGORY'), 'use_jquery_ui_slider' => (bool) Configuration::get('PS_USE_JQUERY_UI_SLIDER'), 'default_category_template' => Configuration::get('PS_LAYERED_DEFAULT_CATEGORY_TEMPLATE'), - 'link' => $this->context->link, + 'add_new_filters_template_link' => $this->context->link->getAdminLink('AdminModules', true, [], ['configure' => 'ps_facetedsearch', 'add_new_filters_template' => 1]), ]); return $this->display(__FILE__, 'views/templates/admin/manage.tpl'); @@ -976,6 +976,18 @@ private function getExistingFiltersOverview() } else { $filters_templates[$k]['date_add'] = Tools::displayDate($v['date_add'], null, true); } + + $filters_templates[$k]['edit_link'] = $this->context->link->getAdminLink('AdminModules', true, [], [ + 'configure' => 'ps_facetedsearch', + 'edit_filters_template' => 1, + 'id_layered_filter' => (int) $v['id_layered_filter'] + ]); + + $filters_templates[$k]['remove_link'] = $this->context->link->getAdminLink('AdminModules', true, [], [ + 'configure' => 'ps_facetedsearch', + 'deleteFilterTemplate' => 1, + 'id_layered_filter' => (int) $v['id_layered_filter'] + ]); } return $filters_templates; diff --git a/views/templates/admin/manage.tpl b/views/templates/admin/manage.tpl index 4553046b9..b58289dce 100644 --- a/views/templates/admin/manage.tpl +++ b/views/templates/admin/manage.tpl @@ -75,13 +75,7 @@ {if empty($limit_warning)}
- + {l s='Edit' d='Admin.Actions'}