您现在的位置是:首页 > cms教程 > ecshop商城教程ecshop商城教程
二次开发的大型ecshop搬家升级错误等问题解决方法
谷山2025-02-08 10:20:03ecshop商城教程已有7人查阅
导读最近将ECShop框架网站从租用服务器搬家至阿里云,虽然模块及功能上已经被修改的面目全非了,但基础部分还在。在这个过程中遇到了很多的WARNING与ERROR,解决方案如下。
最近将ECShop框架网站从租用服务器搬家至阿里云,虽然模块及功能上已经被修改的面目全非了,但基础部分还在。
在这个过程中遇到了很多的WARNING与ERROR,解决方案如下。
【环境】
服务器环境由PHP5.3+MySQL5.6更新至PHP5.6+MySQL5.7
【数据库】
利用navicat for mysql工具导入导出,出现异常:Invalid default value for 'create_time',具体可参考上一篇随笔。http:// .cnblogs.com/eDevelop/p/7081061.html
【后台】
打开首页报错,提示:
Strict standards: Non-static method cls_image::gd_version() should not be called statically in includes\lib_base.php on line 355
return cls_image::gd_version();
对象可以访问静态方法,使用的是$p->function(),对象访问静态属性采用p::function()形式。 类似还有:
Strict standards: Non-static method cls_sql_dump::get_random_name() should not be called statically in admin\database.php on line 64 修改为: 嫌麻烦直接找到function get_random_name()函数,前面加个static完事。
个人设置:
Strict standards: Only variables should be passed by reference in includes\cls_template.php on line 422 调用函数传参错误 商品分类:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead inincludes\cls_template.php on line 304
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
PHP升级5.5之后,摒弃了preg_replace的/e特性。 问题集中在cls_template中。
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in includes\cls_template.php on line 554 修改为: 修改为: 修改为: 历史订单:查看->配送方式:编辑
Warning: Illegal string offset 'free_money' in admin\order.php on line 3696
使用$shipping['configure']['free_money']形式,要求$shipping['configure']为数组,可以引入IF判断解决 Warning: number_format() expects parameter 1 to be double, string given in includes\lib_common.php on line 1019
虽然ECShop2.7.3对参数$price进行判断是否为空,但配送插件里面的免费额度为0,ec本身的bug导致了$price的值为空值,直接调用number_format出现了错误。
在PHP5.3上报错,但获取到的应该是一个字符串,所以出错,应该这样改: 商店设置:
Strict standards: mktime(): You should be using the time() function instead in admin\sms_url.php on line 31
Strict standards: mktime(): You should be using the time() function instead in admin\shop_config.php on line 32
mktime()方法不带参数被调用时,会被抛出一个报错提示。 修改为: 管理员权限与角色管理:
Warning: join(): Invalid arguments passed in admin\privilege.php on line 602
Warning: Invalid argument supplied for foreach() in admin\privilege.php on line 604
Warning: join(): Invalid arguments passed in admin\role.php on line 217
Warning: Invalid argument supplied for foreach() in admin\role.php on line 219
这里与上上个错误类似,数组类型取值才不会警告。
使用if(is_array($action_group['priv'])){}将join与foreach代码段包进去。
网上给出方案如下,感觉大同小异。 自定义导航栏也报错:
Warning: Illegal string offset 'cat_name' in admin\navigator.php on line 383 角色管理与权限管理:只有checkbox选框,没有label文字
锁定privilege_allot.htm与role_info.htm,修改如下: 数据备份:
Strict standards: Redefining already defined constructor for class cls_sql_dump in admin\includes\cls_sql_dump.php on line 90
类似还有支付方式:
Strict Standards: Redefining already defined constructor for class chinabank in includes/modules/payment/chinabank.php on line 85
Strict Standards: Redefining already defined constructor for class paypal_ec in includes/modules/payment/paypal_ec.php on line 96
Strict Standards: Redefining already defined constructor for class shenzhou in includes/modules/payment/shenzhou.php on line 81
Strict Standards: Redefining already defined constructor for class ips in includes/modules/payment/ips.php on line 82
Strict Standards: Redefining already defined constructor for class balance in includes/modules/payment/balance.php on line 79
Strict Standards: Redefining already defined constructor for class alipay in includes/modules/payment/alipay.php on line 85
Strict Standards: Redefining already defined constructor for class tenpay in includes/modules/payment/tenpay.php on line 83
Strict Standards: Redefining already defined constructor for class post in includes/modules/payment/post.php on line 79
Strict Standards: Redefining already defined constructor for class paypal in includes/modules/payment/paypal.php on line 82
Strict Standards: Redefining already defined constructor for class tenpayc2c in includes/modules/payment/tenpayc2c.php on line 83
Strict Standards: Redefining already defined constructor for class cappay in includes/modules/payment/cappay.php on line 81
Strict Standards: Redefining already defined constructor for class bank in includes/modules/payment/bank.php on line 79
Strict Standards: Redefining already defined constructor for class kuaiqian in includes/modules/payment/kuaiqian.php on line 83
Strict Standards: Redefining already defined constructor for class cod in includes/modules/payment/cod.php on line 82
使用和类名相同点函数名作为构造函数是php4时代的写法,php5时代的构造函数是__construct(),ecshop为了兼容老版本的php,所以采用了上面的写法。
但是从php5.4开始,对于这样的两种写法同时出现的情况,要求必须__construct()在前,同名函数在后,所以只需要对调两个函数的位置即可。
如alipay.php,将 放到 前面。
首页广告管理:
Strict standards: Only variables should be passed by reference in admin\flashplay.php on line 274
传参时赋值,偷懒了。 修改为: 后台翻页功能失效,弹出 transport.js /run() error:undefined。
FF调试报错: ECShop把AJAX事件和JSON解析的模块放在common/transport.js之中,在封装JSON各种方法的同时对object的模型进行了重写,跟jQuery冲突!
ECShop论坛上提出了一些办法,不是很好用。
1、首先复制一份 transport.js 改名为 transport.org.js 提供给后台使用
2、屏蔽掉transport.js里的toJSON功能,注释掉行数大概在497-737行之间的内容,从if ( ! Object.prototype.toJSONString)开始
修改352行为: 修改408行为: 屏蔽掉global.js里的如下代码(第10-13行): 3、修改index.js文件44行为: 4、修改common.js文件34行为: 修改850行为: 修改1056行为: 5、修改compare.js文件49行为: 修改67行为: 修改133行为: 6、修改global.js文件
修改16行函数名 : 修改114和126行为: 7、修改后台头部引入transport.js路径
admin/templates/pageheader.htm 第9行改为: {insert_scripts files="../js/transport.org.js,common.js"}
admin/templates/menu.htm 第151行改为: 8、修改themes/default/library/page_header.lbi文件在 上面加上: jquery.json.js下载9、修改library/comment_list.lbi 188行为: 10、修改compare.dwt 20行为: 24行: 11、修改flow.dwt 138行为: 199行: 12、修改brand.dwt、brand_list.dwt、category.dwt、exchange_list.dwt、search.dwt文件,增加 注意:包括其他jquery文件需置顶的dwt文件,jquery.js文件需要在compare.js文件加载前加载
大概思路就是屏蔽ECshop扩展的toJSONString方法,用别的函数代替。
在这个过程中遇到了很多的WARNING与ERROR,解决方案如下。
【环境】
服务器环境由PHP5.3+MySQL5.6更新至PHP5.6+MySQL5.7
【数据库】
利用navicat for mysql工具导入导出,出现异常:Invalid default value for 'create_time',具体可参考上一篇随笔。http:// .cnblogs.com/eDevelop/p/7081061.html
【后台】
打开首页报错,提示:
Strict standards: Non-static method cls_image::gd_version() should not be called statically in includes\lib_base.php on line 355
return cls_image::gd_version();
对象可以访问静态方法,使用的是$p->function(),对象访问静态属性采用p::function()形式。 类似还有:
Strict standards: Non-static method cls_sql_dump::get_random_name() should not be called statically in admin\database.php on line 64 修改为: 嫌麻烦直接找到function get_random_name()函数,前面加个static完事。
个人设置:
Strict standards: Only variables should be passed by reference in includes\cls_template.php on line 422 调用函数传参错误 商品分类:
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead inincludes\cls_template.php on line 304
return preg_replace("/{([^\}\{\n]*)}/e", "\$this->select('\\1');", $source);
PHP升级5.5之后,摒弃了preg_replace的/e特性。 问题集中在cls_template中。
Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in includes\cls_template.php on line 554 修改为: 修改为: 修改为: 历史订单:查看->配送方式:编辑
Warning: Illegal string offset 'free_money' in admin\order.php on line 3696
使用$shipping['configure']['free_money']形式,要求$shipping['configure']为数组,可以引入IF判断解决 Warning: number_format() expects parameter 1 to be double, string given in includes\lib_common.php on line 1019
虽然ECShop2.7.3对参数$price进行判断是否为空,但配送插件里面的免费额度为0,ec本身的bug导致了$price的值为空值,直接调用number_format出现了错误。
在PHP5.3上报错,但获取到的应该是一个字符串,所以出错,应该这样改: 商店设置:
Strict standards: mktime(): You should be using the time() function instead in admin\sms_url.php on line 31
Strict standards: mktime(): You should be using the time() function instead in admin\shop_config.php on line 32
mktime()方法不带参数被调用时,会被抛出一个报错提示。 修改为: 管理员权限与角色管理:
Warning: join(): Invalid arguments passed in admin\privilege.php on line 602
Warning: Invalid argument supplied for foreach() in admin\privilege.php on line 604
Warning: join(): Invalid arguments passed in admin\role.php on line 217
Warning: Invalid argument supplied for foreach() in admin\role.php on line 219
这里与上上个错误类似,数组类型取值才不会警告。
使用if(is_array($action_group['priv'])){}将join与foreach代码段包进去。
网上给出方案如下,感觉大同小异。 自定义导航栏也报错:
Warning: Illegal string offset 'cat_name' in admin\navigator.php on line 383 角色管理与权限管理:只有checkbox选框,没有label文字
锁定privilege_allot.htm与role_info.htm,修改如下: 数据备份:
Strict standards: Redefining already defined constructor for class cls_sql_dump in admin\includes\cls_sql_dump.php on line 90
类似还有支付方式:
Strict Standards: Redefining already defined constructor for class chinabank in includes/modules/payment/chinabank.php on line 85
Strict Standards: Redefining already defined constructor for class paypal_ec in includes/modules/payment/paypal_ec.php on line 96
Strict Standards: Redefining already defined constructor for class shenzhou in includes/modules/payment/shenzhou.php on line 81
Strict Standards: Redefining already defined constructor for class ips in includes/modules/payment/ips.php on line 82
Strict Standards: Redefining already defined constructor for class balance in includes/modules/payment/balance.php on line 79
Strict Standards: Redefining already defined constructor for class alipay in includes/modules/payment/alipay.php on line 85
Strict Standards: Redefining already defined constructor for class tenpay in includes/modules/payment/tenpay.php on line 83
Strict Standards: Redefining already defined constructor for class post in includes/modules/payment/post.php on line 79
Strict Standards: Redefining already defined constructor for class paypal in includes/modules/payment/paypal.php on line 82
Strict Standards: Redefining already defined constructor for class tenpayc2c in includes/modules/payment/tenpayc2c.php on line 83
Strict Standards: Redefining already defined constructor for class cappay in includes/modules/payment/cappay.php on line 81
Strict Standards: Redefining already defined constructor for class bank in includes/modules/payment/bank.php on line 79
Strict Standards: Redefining already defined constructor for class kuaiqian in includes/modules/payment/kuaiqian.php on line 83
Strict Standards: Redefining already defined constructor for class cod in includes/modules/payment/cod.php on line 82
使用和类名相同点函数名作为构造函数是php4时代的写法,php5时代的构造函数是__construct(),ecshop为了兼容老版本的php,所以采用了上面的写法。
但是从php5.4开始,对于这样的两种写法同时出现的情况,要求必须__construct()在前,同名函数在后,所以只需要对调两个函数的位置即可。
如alipay.php,将 放到 前面。
首页广告管理:
Strict standards: Only variables should be passed by reference in admin\flashplay.php on line 274
传参时赋值,偷懒了。 修改为: 后台翻页功能失效,弹出 transport.js /run() error:undefined。
FF调试报错: ECShop把AJAX事件和JSON解析的模块放在common/transport.js之中,在封装JSON各种方法的同时对object的模型进行了重写,跟jQuery冲突!
ECShop论坛上提出了一些办法,不是很好用。
1、首先复制一份 transport.js 改名为 transport.org.js 提供给后台使用
2、屏蔽掉transport.js里的toJSON功能,注释掉行数大概在497-737行之间的内容,从if ( ! Object.prototype.toJSONString)开始
修改352行为: 修改408行为: 屏蔽掉global.js里的如下代码(第10-13行): 3、修改index.js文件44行为: 4、修改common.js文件34行为: 修改850行为: 修改1056行为: 5、修改compare.js文件49行为: 修改67行为: 修改133行为: 6、修改global.js文件
修改16行函数名 : 修改114和126行为: 7、修改后台头部引入transport.js路径
admin/templates/pageheader.htm 第9行改为: {insert_scripts files="../js/transport.org.js,common.js"}
admin/templates/menu.htm 第151行改为: 8、修改themes/default/library/page_header.lbi文件在 上面加上: jquery.json.js下载9、修改library/comment_list.lbi 188行为: 10、修改compare.dwt 20行为: 24行: 11、修改flow.dwt 138行为: 199行: 12、修改brand.dwt、brand_list.dwt、category.dwt、exchange_list.dwt、search.dwt文件,增加 注意:包括其他jquery文件需置顶的dwt文件,jquery.js文件需要在compare.js文件加载前加载
大概思路就是屏蔽ECshop扩展的toJSONString方法,用别的函数代替。
本文标签:
很赞哦! (0)
暂无内容 |
暂无内容 |
相关文章
暂无内容 |
暂无内容 |
随机图文
ecshop用户中心我的订单显示收货人及商品缩略图
ECSHOP系统用户中心我的订单中不能显示收货人及商品缩略图图,没有这个非常不方便。好在ECSHOP是开源的,通过以下方法可以实现:ecshop商品列表分类页的商品显示商家品牌的方法
各位ECSHOP网店系统用户大家好,欢迎来到代码号图文教程,今天为大家详细解说一下ECSHOP商品列表分类页的商品显示商家品牌修改方法。ecshop函数标签说明整理
lib_base.php 基础函数库 1.sub_str($str, $length = 0, $append = true) 截取UTF-8编码下字符串的函数 string $str 被截取的字符串 int $length 截取的长ecshop管理员密码忘记了怎么办?
不小心在后台把管理员全部给清空了,闹的网站都无法登陆了?有没办法ecshop这恢复管理员,好有个用户进去再去增加管理员呢?其实方法很简单手动在phpmyadmin增加下。
留言与评论 (共有 0 条评论) |