dongyuan9292 2019-03-14 10:25
浏览 63
已采纳

prestashop模块控制器中的“找不到页面”

I'm developing my module and in localhost I have created tab in back office and when I click on this tab controller works fine , But when I upload this module on my real host module can create tab with no problem but when I click on this tab prestashop will show "Page not found !"

this is my code

        $name="My test name";
    $tab = new Tab();
    $tab->id_parent=(int)Tab::getIdFromClassName('AdminParentModulesSf');
    $tab->name=array();
    foreach (Language::getLanguages(true) as $lang){
        $tab->name[$lang['id_lang']]=$name;
    }
    $tab->class_name='AdminMyTest';
    $tab->module=$this->name;
    $tab->active=1;
    $tab->add();

and I have created admin/controllers/AdminMyTest.php

class AdminMyTestController extends ModuleAdminController
{
}

So , have you any idea whats wrong ? Prestashop version is 1.7.4

thanks

  • 写回答

1条回答 默认 最新

  • douju4278 2019-03-16 16:43
    关注

    I have solved this problem ! I think this is Prestashop bug , when we use module class name with lower and upper case for example "MyModule" , when we create a tab , in table ps_tab module field will change to lowercase ! and when we click on tab , prestashop says page not found !

    to fix this problem you should edit module field in ps_tab and change it to real name in according to lower case and upper case for example change it to "MyModule" because now this is "mymodule" or you can change your module name and name it just with lowercase !

    I hope this help you

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 vc6.0中想运行代码的时候总是提示无法打开文件是怎么回事
  • ¥25 关于##爬虫##的问题,如何解决?:
  • ¥15 ZABBIX6.0L连接数据库报错,如何解决?(操作系统-centos)
  • ¥15 找一位技术过硬的游戏pj程序员
  • ¥15 matlab生成电测深三层曲线模型代码
  • ¥50 随机森林与房贷信用风险模型
  • ¥50 buildozer打包kivy app失败
  • ¥30 在vs2022里运行python代码
  • ¥15 不同尺寸货物如何寻找合适的包装箱型谱
  • ¥15 求解 yolo算法问题