From fcc2334641c61c7fd57c8a4377fcb7a1cf0a2e45 Mon Sep 17 00:00:00 2001 From: Ivan Bochkarev Date: Thu, 13 Aug 2026 23:08:50 +0600 Subject: [PATCH] fix(mgr): declare ms3 via addVueConfig on help page Help assigned ms3.config without var ms3, which throws ReferenceError before the Vue module mounts. Reuse the same helper as other Vue mgr pages. --- .../minishop3/controllers/mgr/help.class.php | 11 ++-- .../minishop3/tests/HelpVueEntryTest.php | 54 +++++++++++++++++++ 2 files changed, 57 insertions(+), 8 deletions(-) create mode 100644 core/components/minishop3/tests/HelpVueEntryTest.php diff --git a/core/components/minishop3/controllers/mgr/help.class.php b/core/components/minishop3/controllers/mgr/help.class.php index 053270d31..9424913a5 100644 --- a/core/components/minishop3/controllers/mgr/help.class.php +++ b/core/components/minishop3/controllers/mgr/help.class.php @@ -27,17 +27,12 @@ public function getLanguageTopics() */ public function loadCustomCssJs() { - // Vue CSS + // Config before Vue modules so mount sees ms3.config (#553). + $this->addVueConfig($this->ms3->config); + $this->addCss($this->ms3->config['assetsUrl'] . 'css/mgr/vue-dist/primeicons.min.css'); $this->addCss($this->ms3->config['assetsUrl'] . 'css/mgr/vue-dist/help.min.css'); - - // Vue module $this->addVueModule($this->ms3->config['jsUrl'] . 'mgr/vue-dist/help.min.js'); - - // Pass config to JavaScript - $this->addHtml(''); } /** diff --git a/core/components/minishop3/tests/HelpVueEntryTest.php b/core/components/minishop3/tests/HelpVueEntryTest.php new file mode 100644 index 000000000..fee417b8d --- /dev/null +++ b/core/components/minishop3/tests/HelpVueEntryTest.php @@ -0,0 +1,54 @@ + $modulePos) { + $fail('help controller must call addVueConfig() before addVueModule()'); +} + +$entry = $repoRoot . '/vueManager/src/entries/help.js'; +$entrySrc = is_file($entry) ? file_get_contents($entry) : false; +if ($entrySrc === false || !str_contains($entrySrc, '#ms3-vue-help')) { + $fail('help entry must mount #ms3-vue-help'); +} + +fwrite(STDOUT, "OK HelpVueEntryTest\n"); +exit(0);