From 98428e46aeb61cc0ceb775b9b3f924da03376f83 Mon Sep 17 00:00:00 2001 From: Ivan Bochkarev Date: Tue, 17 Mar 2026 10:13:20 +0600 Subject: [PATCH 1/2] fix(product): cast publish_document to int in create controller Ensures publish_document is consistently cast to (int) in the JS config, matching the same pattern used for canSave and show_tvs. --- core/components/minishop3/controllers/product/create.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/components/minishop3/controllers/product/create.class.php b/core/components/minishop3/controllers/product/create.class.php index c2af4ac5..31ec4e9e 100644 --- a/core/components/minishop3/controllers/product/create.class.php +++ b/core/components/minishop3/controllers/product/create.class.php @@ -132,7 +132,7 @@ public function loadCustomCssJs() 'xtype' => 'ms3-page-product-create', 'resource' => $this->resource->get('id'), 'record' => $this->resourceArray, - 'publish_document' => $this->canPublish, + 'publish_document' => (int) $this->canPublish, 'canSave' => (int) ($this->canSave && $this->modx->hasPermission('msproduct_save')), 'show_tvs' => (int) !empty($this->tvCounts), 'mode' => 'create', From 6b73ce255b281360b292fd39927ab2950a7eb62d Mon Sep 17 00:00:00 2001 From: Ivan Bochkarev Date: Tue, 17 Mar 2026 10:22:12 +0600 Subject: [PATCH 2/2] fix(category): persist hide_children_in_tree checkbox for categories Add handleCheckBoxes() with setCheckbox('hide_children_in_tree') in Category/Update and Category/Create so the setting is saved correctly. Fixes #161 --- .../minishop3/src/Processors/Category/Create.php | 9 +++++++++ .../minishop3/src/Processors/Category/Update.php | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/core/components/minishop3/src/Processors/Category/Create.php b/core/components/minishop3/src/Processors/Category/Create.php index 6ae89e6d..0c50c723 100644 --- a/core/components/minishop3/src/Processors/Category/Create.php +++ b/core/components/minishop3/src/Processors/Category/Create.php @@ -30,6 +30,15 @@ public function prepareAlias() } + /** + * @return void + */ + public function handleCheckBoxes() + { + parent::handleCheckBoxes(); + $this->setCheckbox('hide_children_in_tree'); + } + /** * @return bool */ diff --git a/core/components/minishop3/src/Processors/Category/Update.php b/core/components/minishop3/src/Processors/Category/Update.php index 0b4810c2..0b386940 100644 --- a/core/components/minishop3/src/Processors/Category/Update.php +++ b/core/components/minishop3/src/Processors/Category/Update.php @@ -53,6 +53,15 @@ public function checkFriendlyAlias() } + /** + * @return void + */ + public function handleCheckBoxes() + { + parent::handleCheckBoxes(); + $this->setCheckbox('hide_children_in_tree'); + } + /** * @return bool */