Xedos20091 Posted May 15, 2020 Share Posted May 15, 2020 AdminParentMyCustomModuleHi! I in my module create two links in tab menu: private function installTab(Module $module): bool { $tabId = (int) Tab::getIdFromClassName('AdminParentMyCustomModule'); if (!$tabId) { $tab = new Tab(); $tab->active = 1; $tab->class_name = 'AdminParentMyCustomModule'; $tab->name = array(); foreach (Language::getLanguages(true) as $lang) { $tab->name[$lang['id_lang']] = 'AdminParentMyCustomModule'; } $tab->id_parent = Tab::getIdFromClassName('AdminCatalog'); $tab->module = $module->name; if (!$tab->add()) { return false; } } $tabId = (int) Tab::getIdFromClassName('AdminMyCustomModule'); if (!$tabId) { $tab = new Tab(); $tab->active = 1; $tab->class_name = 'AdminMyCustomModule'; $tab->name = array(); foreach (Language::getLanguages(true) as $lang) { $tab->name[$lang['id_lang']] = 'AdminMyCustomModule'; } $tab->id_parent = (int) Tab::getIdFromClassName('AdminParentMyCustomModule'); $tab->module = $module->name; if(!$tab->add()) { return false; } } $tabId = (int) Tab::getIdFromClassName('AdminMyCustomModuleProduct'); if (!$tabId) { $tab = new Tab(); $tab->active = 1; $tab->class_name = 'AdminMyCustomModuleProduct'; $tab->name = array(); foreach (Language::getLanguages(true) as $lang) { $tab->name[$lang['id_lang']] = 'AdminMyCustomModuleProduct'; } $tab->id_parent = (int) Tab::getIdFromClassName('AdminParentMyCustomModule'); $tab->module = $module->name; if(!$tab->add()) { return false; } } return true; } After install my module in tab menu generating two links: http://localhost/admin777/index.php/modules/mycustommodule/?_token=uDrV1ezY17wRAj4H2pjfNPjU-G2gaa3VwpZVhr6l1oM and http://localhost/admin777/index.php?controller=AdminMyCustomModuleProduct&token=607d95d3a53b0c96d4a6c4c82f8dc2c0 Why do links look different? And the second link is not working. How can I fix the second link? Thank You. Link to comment Share on other sites More sharing options...
Janett Posted May 16, 2020 Share Posted May 16, 2020 I think it’s because of Symfony migration of PrestaShop BO 1.7, but it’s not finished yet so there are some bugs like that. Maybe you should report that on GitHub for PrestaShop developers : https://github.com/PrestaShop/PrestaShop/issues/new/choose Link to comment Share on other sites More sharing options...
Xedos20091 Posted May 17, 2020 Author Share Posted May 17, 2020 Thanks for the answer. I found my mistake, it was in the routes.yml file. Link to comment Share on other sites More sharing options...
Oak & Aspen Posted October 28, 2020 Share Posted October 28, 2020 Could you please provide your solution? I have the same issue. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now