From 98428e46aeb61cc0ceb775b9b3f924da03376f83 Mon Sep 17 00:00:00 2001 From: Ivan Bochkarev Date: Tue, 17 Mar 2026 10:13:20 +0600 Subject: [PATCH 1/3] 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/3] 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 */ From c264739d20e91ebce5941152d728704eec598574 Mon Sep 17 00:00:00 2001 From: biz87 Date: Sat, 28 Mar 2026 13:51:06 +0500 Subject: [PATCH 3/3] fix: cast publish_document to (int) in all controllers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Применяет (int) каст для publish_document во всех контроллерах (category/create, category/update, product/update) для консистентности с product/create, где каст уже был добавлен. --- core/components/minishop3/controllers/category/create.class.php | 2 +- core/components/minishop3/controllers/category/update.class.php | 2 +- core/components/minishop3/controllers/product/update.class.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/components/minishop3/controllers/category/create.class.php b/core/components/minishop3/controllers/category/create.class.php index 5e9d7011..571fe372 100644 --- a/core/components/minishop3/controllers/category/create.class.php +++ b/core/components/minishop3/controllers/category/create.class.php @@ -70,7 +70,7 @@ public function loadCustomCssJs() 'record' => array_merge($this->resourceArray, [ 'isfolder' => true, ]), - 'publish_document' => $this->canPublish, + 'publish_document' => (int) $this->canPublish, 'canSave' => (int) ($this->canSave && $this->modx->hasPermission('mscategory_save')), 'show_tvs' => (int) !empty($this->tvCounts), 'mode' => 'create', diff --git a/core/components/minishop3/controllers/category/update.class.php b/core/components/minishop3/controllers/category/update.class.php index 3bea057e..7c9f1c9c 100644 --- a/core/components/minishop3/controllers/category/update.class.php +++ b/core/components/minishop3/controllers/category/update.class.php @@ -84,7 +84,7 @@ public function loadCustomCssJs() 'xtype' => 'ms3-page-category-update', 'resource' => $this->resource->get('id'), 'record' => $this->resourceArray, - 'publish_document' => $this->canPublish, + 'publish_document' => (int) $this->canPublish, 'preview_url' => $this->previewUrl, 'locked' => $this->locked, 'lockedText' => $this->lockedText, diff --git a/core/components/minishop3/controllers/product/update.class.php b/core/components/minishop3/controllers/product/update.class.php index 0be76841..a6c1cd86 100644 --- a/core/components/minishop3/controllers/product/update.class.php +++ b/core/components/minishop3/controllers/product/update.class.php @@ -133,7 +133,7 @@ public function loadCustomCssJs() 'xtype' => 'ms3-page-product-update', 'resource' => $this->resource->get('id'), 'record' => $this->resourceArray, - 'publish_document' => $this->canPublish, + 'publish_document' => (int) $this->canPublish, 'preview_url' => $this->previewUrl, 'locked' => $this->locked, 'lockedText' => $this->lockedText,