2013-10-08 88 views
0

即时通讯新的整个电子商务场景,但即时通讯试图让它在哪里OpenCart将与ShipStation合作填写发货订单和处理它们的付款。但是,即使在error_log中为ShipStation扩展模块发生此错误。由于时间问题导致自动导入的ShipStation问题?

更新: 什么应该发生的时候,即时通讯应用程序ShipStation,并点击从商店更新,它发送一个请求,这个export.php脚本(这就是我的错误)。

2013-10-07 20:25:03 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 20:25:03 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 20:25:03 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 20:25:03 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-07 22:25:08 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 15 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 1 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: Undefined offset: 2 in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 
2013-10-08 0:21:11 - PHP Notice: A non well formed numeric value encountered in /home/begumbou/public_html/shipstation/controller/export.php on line 22 

线15个状态

$data['startdate'] = date('Y-m-d H:i:s', mktime($starttime[0], $starttime[1], 0, $startdate[0], $startdate[1], $startdate[2])); 

和线22个状态

$data['enddate'] = date('Y-m-d H:i:s', mktime($endtime[0], $endtime[1], 0, $enddate[0], $enddate[1], $enddate[2])); 

赫雷什所有的代码放在一起

if (isset($this->request->get['start_date'])) { 
     $start_date_time = explode(' ', $this->request->get['start_date']); 
     $startdate = explode('/', $start_date_time[0]); 
     $starttime = explode(':', $start_date_time[1]); 
     $data['startdate'] = date('Y-m-d H:i:s', mktime($starttime[0], $starttime[1], 0, $startdate[0], $startdate[1], $startdate[2])); 
    } 

    if (isset($this->request->get['end_date'])) { 
     $end_date_time = explode(' ', $this->request->get['end_date']); 
     $enddate = explode('/', $end_date_time[0]); 
     $endtime = explode(':', $end_date_time[1]); 
     $data['enddate'] = date('Y-m-d H:i:s', mktime($endtime[0], $endtime[1], 0, $enddate[0], $enddate[1], $enddate[2])); 

UPDATE的error_log

[08-Oct-2013 17:33:39 UTC] Array 
(
    [0] => 01%3a08 
) 

[08-Oct-2013 17:33:39 UTC] Array 
(
    [0] => 17%3a33 
) 

这是在raw_error_logs上,它匹配上面给出的数组。

162.209.46.39 - - [08/Oct/2013:13:33:39 -0400] "GET /shipstation/index.php?action=export&start_date=10%2f08%2f2013+01%3a08&end_date=10%2f08%2f2013+17%3a33&page=1&SS-UserName=R4ND0ML3TT3RSANDNUB3RS1T00K0UT&SS-Password=R4ND0ML3TT3RSANDNUB3RS1T00K0UT HTTP/1.1" 302 448 "-" "ShipStation" 
+0

你能告诉我们var_dump($ starttime);'''var_dump($ endtime')的输出吗?您在小时,每月,每分钟和每天都使用相同的值,但必须是错误的。用'error_reporting(-1);'和'ini_set('display_errors',true);'开始开发。 –

+0

@Glavić'你对小时和月,分,日使用相同的值 - 我认为你和你完全一样,但事实是他正在使用'$ startdate'和'$ starttime'和'$ enddate'并且'$ endtime'变量... – shadyyx

+0

@shadyyx:lol,错过了;)但是,当他转储这个变量时,他/我们会发现问题;) –

回答

1

通过GET链接,您已给出GET /shipstation/index.php?action=export&start_date=10%2f08%2f2013+01%3a08&...,不应发生通知。

start_dateend_date的格式与预期不同时,会发出通知。

替换代码:

if (isset($this->request->get['start_date'])) { ... } 
if (isset($this->request->get['end_date'])) { ... } 

有:

foreach (array('start_date', 'end_date') as $field) { 
    if (!isset($this->request->get[$field])) continue; 
    $date = $this->request->get[$field]; 
    try { 
     $dt = new DateTime($date); 
     $data[str_replace('_', '', $field)] = $dt->format('Y-m-d H:i:s'); 
    } catch (Exception $e) { 
     exit("ERROR: Field '{$field}' has invalid datetime format = '{$date}' ({$e->getMessage()})"); 
    } 
} 

,看看是否发生错误。