2.15.1升级2.17.4报错 ...Order::trackingShip....should be compatible with...

安装报错 · ivanye211 · 于 2年前 发布 · 1069 次阅读

从2.15.1升级到2.17.4 前后台报错

后台报错详细如下:(回退到2.15.1又全部正常了)

PHP Warning – yii\base\ErrorException Declaration of fecro\services\Order::trackingShip($orderId, $trackingCompanyCode, $trackingNumber) should be compatible with fecshop\services\Order::trackingShip($orderId, $trackingCompanyCode, $trackingNumber, $trackingCompanyName = '')

  1. in /www/wwwroot/(此处隐藏域名)/addons/fecmall/fecro/services/Order.phpat line 23

    /**
     * Order services.
     *
     * @property \fecshop\services\order\Item $item
     *
     * @author Terry Zhao <2358269014@qq.com>
     * @since 1.0
     */
    class Order extends \fecshop\services\Order
    {
     // 订单已收货
     public $status_received                 = 'received';
     
     // 供应商后台审核不通过状态
     public $status_audit_fail                   = 'order_audit_fail';
     
     /** 订单支付成功后,清空购物车?  
      *  True: 代表订单支付 成功后,清空购物车
    
  2. in /www/wwwroot/(此处隐藏域名)/addons/fecmall/fecro/services/Order.php at line 23– yii\base\ErrorHandler::handleError(2, 'Declaration of fecro\services\Or...', '/www/wwwroot/vape.ibeyondtech.co...', 23, ...)

     *
     * @property \fecshop\services\order\Item $item
     *
     * @author Terry Zhao <2358269014@qq.com>
     * @since 1.0
     */
    class Order extends \fecshop\services\Order
    {
     // 订单已收货
     public $status_received                 = 'received';
     
     // 供应商后台审核不通过状态
     public $status_audit_fail                   = 'order_audit_fail';
    
  3. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/BaseYii.php at line 293– include('/www/wwwroot/vape.ibeyondtech.co...')

                 return;
             }
         } else {
             return;
         }
     
         include $classFile;
     
         if (YII_DEBUG && !class_exists($className, false) && !interface_exists($className, false) && !trait_exists($className, false)) {
             throw new UnknownClassException("Unable to find '$className' in file: $classFile. Namespace missing?");
         }
     }
    
  4. yii\BaseYii::autoload('fecro\services\Order')
  5. spl_autoload_call('fecro\services\Order')
  6. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/di/Container.php at line 508– ReflectionClass::__construct('fecro\services\Order')

         if (isset($this->_reflections[$class])) {
             return [$this->_reflections[$class], $this->_dependencies[$class]];
         }
     
         $dependencies = [];
         try {
             $reflection = new ReflectionClass($class);
         } catch (\ReflectionException $e) {
             throw new NotInstantiableException(
                 $class,
                 'Failed to instantiate component or class "' . $class . '".',
                 0,
                 $e
    
  7. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/di/Container.php at line 386– yii\di\Container::getDependencies('fecro\services\Order')

      * @return object the newly created instance of the specified class
      * @throws NotInstantiableException If resolved to an abstract class or an interface (since 2.0.9)
      */
     protected function build($class, $params, $config)
     {
         /* @var $reflection ReflectionClass */
         list($reflection, $dependencies) = $this->getDependencies($class);
     
         $addDependencies = [];
         if (isset($config['__construct()'])) {
             $addDependencies = $config['__construct()'];
             unset($config['__construct()']);
         }
    
  8. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/di/Container.php at line 171– yii\di\Container::build('fecro\services\Order', [], ['childService' => ['item' => ['class' => 'fecshop\services\order\Item'], 'info' => ['class' => 'fecro\services\order\Info'], 'afterSale' => ['class' => 'fecro\services\order\AfterSale']], 'payment_status_pending' => 'payment_pending', 'payment_status_processing' => 'payment_processing', 'payment_status_confirmed' => 'payment_confirmed', ...])

             $class = $class->id;
         }
         if (isset($this->_singletons[$class])) {
             // singleton
             return $this->_singletons[$class];
         } elseif (!isset($this->_definitions[$class])) {
             return $this->build($class, $params, $config);
         }
     
         $definition = $this->_definitions[$class];
     
         if (is_callable($definition, true)) {
             $params = $this->resolveDependencies($this->mergeParams($class, $params));
    
  9. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/BaseYii.php at line 365– yii\di\Container::get('fecro\services\Order', [], ['childService' => ['item' => ['class' => 'fecshop\services\order\Item'], 'info' => ['class' => 'fecro\services\order\Info'], 'afterSale' => ['class' => 'fecro\services\order\AfterSale']], 'payment_status_pending' => 'payment_pending', 'payment_status_processing' => 'payment_processing', 'payment_status_confirmed' => 'payment_confirmed', ...])

             return static::$container->get($class, $params, $type);
         }
     
         if (isset($type['class'])) {
             $class = $type['class'];
             unset($type['class']);
             return static::$container->get($class, $params, $type);
         }
     
         throw new InvalidConfigException('Object configuration must be an array containing a "class" or "__class" element.');
     }
     
     private static $_logger;
    
  10. in /www/wwwroot/(此处隐藏域名)/vendor/fancyecommerce/fecshop/services/Application.php at line 117– yii\BaseYii::createObject(['childService' => ['item' => ['class' => 'fecshop\services\order\Item'], 'info' => ['class' => 'fecro\services\order\Info'], 'afterSale' => ['class' => 'fecro\services\order\AfterSale']], 'payment_status_pending' => 'payment_pending', 'payment_status_processing' => 'payment_processing', 'payment_status_confirmed' => 'payment_confirmed', ...])

    {
        if (!isset($this->_childService[$childServiceName]) || !$this->_childService[$childServiceName]) {
            $childService = $this->childService;
            if (isset($childService[$childServiceName])) {
                $service = $childService[$childServiceName];
                if (!isset($service['enableService']) || $service['enableService']) {
                    $this->_childService[$childServiceName] = Yii::createObject($service);
                } else {
     
                    throw new InvalidConfigException('Child Service ['.$childServiceName.'] is disabled in '.get_called_class().', you must enable it! ');
                }
            } else {
    
  11. in /www/wwwroot/(此处隐藏域名)/vendor/fancyecommerce/fecshop/services/Application.php at line 140– fecshop\services\Application::getChildService('order')
     * @var string $serviceName service name
     * @return \fecshop\services\Service
     * @throws \yii\base\InvalidConfigException if the service does not exist or the service is disabled
     */
    public function __get($serviceName)
    {
        return $this->getChildService($serviceName);
    }
    }
    
  12. in /www/wwwroot/(此处隐藏域名)/vendor/fancyecommerce/fecshop/services/Systemhelper.php at line 53– fecshop\services\Application::__get('order')
            $customerTotalCount = $customerData['count'];
        }
        // 1.3总量:支付订单总数
        $filter = [
            'select' => ['increment_id'],
            'where'			=> [
                ['in', 'order_status', Yii::$service->order->getOrderPaymentedStatusArr()]
            ],
            'asArray' => true,
        ];
        $orderData = Yii::$service->order->coll($filter);
        $orderTotalCount = 0;
        if (isset($orderData['count']) && $orderData['count']) {
    
  13. in /www/wwwroot/(此处隐藏域名)/vendor/fancyecommerce/fecshop/app/appadmin/theme/base/default/layouts/dashboard.php at line 182– fecshop\services\Systemhelper::getRecentStatisticsInfo()
                <ul class="tabsMoreList">
                    <li><a href="javascript:;"><?= Yii::$service->page->translate->__('My Main Page'); ?></a></li>
                </ul>
                <div class="navTab-panel tabsPageContent layoutBox">
                        <div class="page unitBox">
                             <?php  $recentStatisticsInfo = Yii::$service->systemhelper->getRecentStatisticsInfo();?>
                            <div class="row page-home">
                                <div class="am-u-sm-12 am-u-md-12 am-u-lg-12 am-margin-bottom">
                                    <div class="widget am-cf">
                                        <div class="widget-head">
                                            <div class="widget-title">商城统计</div>
                                        </div>
    
  14. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/base/View.php at line 348– require('/www/wwwroot/vape.ibeyondtech.co...')
    {
        $_obInitialLevel_ = ob_get_level();
        ob_start();
        ob_implicit_flush(false);
        extract($_params_, EXTR_OVERWRITE);
        try {
            require $_file_;
            return ob_get_clean();
        } catch (\Exception $e) {
            while (ob_get_level() > $_obInitialLevel_) {
                if (!@ob_end_clean()) {
                    ob_clean();
                }
    
  15. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/base/View.php at line 257– yii\base\View::renderPhpFile('/www/wwwroot/vape.ibeyondtech.co...', ['content' => ''])

                    $this->renderers[$ext] = Yii::createObject($this->renderers[$ext]);
                }
                /* @var $renderer ViewRenderer */
                $renderer = $this->renderers[$ext];
                $output = $renderer->render($this, $viewFile, $params);
            } else {
                $output = $this->renderPhpFile($viewFile, $params);
            }
            $this->afterRender($viewFile, $params, $output);
        }
     
        array_pop($this->_viewFiles);
        $this->context = $oldContext;
    
  16. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/base/Controller.php at line 425– yii\base\View::renderFile('/www/wwwroot/vape.ibeyondtech.co...', ['content' => ''], fecshop\app\appadmin\modules\Fecadmin\controllers\IndexController)

     * @since 2.0.1
     */
    public function renderContent($content)
    {
        $layoutFile = $this->findLayoutFile($this->getView());
        if ($layoutFile !== false) {
            return $this->getView()->renderFile($layoutFile, ['content' => $content], $this);
        }
     
        return $content;
    }
     
    /**
    ````
    
  17. in /www/wwwroot/(此处隐藏域名)/vendor/fancyecommerce/fecshop/app/appadmin/modules/AppadminController.php at line 97– yii\base\Controller::renderContent('')

     */
    public function render($view, $params = [])
    {
        $viewFile = Yii::$service->page->theme->getViewFile($view);
        $content = Yii::$app->view->renderFile($viewFile, $params, $this);
     
        return $this->renderContent($content);
    }
     
    /**
     * Get current layoutFile absolute path from mutil theme dir by protity.
     */
    public function findLayoutFile($view)
    
  18. in /www/wwwroot/(此处隐藏域名)/vendor/fancyecommerce/fecshop/app/appadmin/modules/Fecadmin/controllers/IndexController.php at line 28– fecshop\app\appadmin\modules\AppadminController::render('index')

        Yii::$service->page->theme->layoutFile = 'dashboard.php';
        parent::init();
    }
     
    public function actionIndex()
    {
        return $this->render('index');
    }
    

}

19. fecshop\app\appadmin\modules\Fecadmin\controllers\IndexController::actionIndex()
20. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/base/InlineAction.php at line 57– call_user_func_array([fecshop\app\appadmin\modules\Fecadmin\controllers\IndexController, 'actionIndex'], [])
```php
        $args = $this->controller->bindActionParams($this, $params);
        Yii::debug('Running action: ' . get_class($this->controller) . '::' . $this->actionMethod . '()', __METHOD__);
        if (Yii::$app->requestedParams === null) {
            Yii::$app->requestedParams = $args;
        }
 
        return call_user_func_array([$this->controller, $this->actionMethod], $args);
    }
}
  1. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/base/Controller.php at line 181– yii\base\InlineAction::runWithParams(['url_k' => 'config'])

        }
     
        $result = null;
     
        if ($runAction && $this->beforeAction($action)) {
            // run the action
            $result = $action->runWithParams($params);
     
            $result = $this->afterAction($action, $result);
     
            // call afterAction on modules
            foreach ($modules as $module) {
                /* @var $module Module */
    
  2. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/base/Module.php at line 534– yii\base\Controller::runAction('index', ['url_k' => 'config'])

        $parts = $this->createController($route);
        if (is_array($parts)) {
            /* @var $controller Controller */
            list($controller, $actionID) = $parts;
            $oldController = Yii::$app->controller;
            Yii::$app->controller = $controller;
            $result = $controller->runAction($actionID, $params);
            if ($oldController !== null) {
                Yii::$app->controller = $oldController;
            }
     
            return $result;
        }
    
  3. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/web/Application.php at line 104– yii\base\Module::runAction('fecadmin/index/index', ['url_k' => 'config'])

            $params = $this->catchAll;
            unset($params[0]);
        }
        try {
            Yii::debug("Route requested: '$route'", __METHOD__);
            $this->requestedRoute = $route;
            $result = $this->runAction($route, $params);
            if ($result instanceof Response) {
                return $result;
            }
     
            $response = $this->getResponse();
            if ($result !== null) {
    
  4. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/base/Application.php at line 392– yii\web\Application::handleRequest(yii\web\Request)

    {
        try {
            $this->state = self::STATE_BEFORE_REQUEST;
            $this->trigger(self::EVENT_BEFORE_REQUEST);
     
            $this->state = self::STATE_HANDLING_REQUEST;
            $response = $this->handleRequest($this->getRequest());
     
            $this->state = self::STATE_AFTER_REQUEST;
            $this->trigger(self::EVENT_AFTER_REQUEST);
     
            $this->state = self::STATE_SENDING_RESPONSE;
            $response->send();
    
  5. in /www/wwwroot/(此处隐藏域名)/appadmin/web/index.php at line 50– yii\base\Application::run()
     * 使用方法:Yii::$service->cms->article;
     * 上面的例子就是获取cms服务的子服务article。
     */
    new fecshop\services\Application($config);
    

$application = new yii\web\Application($config); $application->run();


前台报错如下(主页可访问,但是只要点击产品,就会报错):

**PHP Warning – yii\base\ErrorException
Illegal string offset 'sku'**


**PHP Warning – yii\base\ErrorException
Illegal string offset 'sku'**
1. in /www/wwwroot/(此处隐藏域名)/vendor/fancyecommerce/fecshop/services/page/Trace.phpat line 230
```php
    public function getTraceProductJsCode($view, $productM)
    {
        // 加入事件event
        $metaAfterEventName = 'event_after_trace_product_js_code';
        Yii::$service->event->trigger($metaAfterEventName, [
            'view' => $view,
            'productM' => $productM,
        ]);
        // 加入FA Trace
        $sku=$productM['sku'];
        $spu=$productM['spu'];
 
        if ($this->traceJsEnable && $sku) {
 
            return "<script type=\"text/javascript\">
    var _maq = _maq || [];
    _maq.push(['sku', '".$sku."']);
    _maq.push(['spu', '".$spu."']);
</script>";
  1. in /www/wwwroot/(此处隐藏域名)/vendor/fancyecommerce/fecshop/services/page/Trace.php at line 230– yii\base\ErrorHandler::handleError(2, 'Illegal string offset 'sku'', '/www/wwwroot/(此处隐藏域名)...', 230, ...)

         $metaAfterEventName = 'event_after_trace_product_js_code';
         Yii::$service->event->trigger($metaAfterEventName, [
             'view' => $view,
             'productM' => $productM,
         ]);
         // 加入FA Trace
         $sku=$productM['sku'];
         $spu=$productM['spu'];
     
         if ($this->traceJsEnable && $sku) {
     
             return "<script type=\"text/javascript\">
     var _maq = _maq || [];
    
  2. in /www/wwwroot/(此处隐藏域名)/addons/fecmall/fecro/app/apphtml5/theme/fecro/catalog/product/index.php at line 327– fecshop\services\page\Trace::getTraceProductJsCode('IB010AS152MX', 'IB010AS152')

    
         });
     });
    <?php $this->endBlock(); ?>  
    </script>  
    <?php $this->registerJs($this->blocks['catalog_produst_info'],\yii\web\View::POS_END);//将编写的js代码注册到页面底部 ?>
    <?= Yii::$service->page->trace->getTraceProductJsCode($sku, $spu)  ?>
    
  3. in /www/wwwroot/(此处隐藏域名)/vendor/yiisoft/yii2/base/View.php at line 348– require('/www/wwwroot/(此处隐藏域名)...')
     {
         $_obInitialLevel_ = ob_get_level();
         ob_start();
         ob_implicit_flush(false);
         extract($_params_, EXTR_OVERWRITE);
         try {
             require $_file_;
             return ob_get_clean();
         } catch (\Exception $e) {
             while (ob_get_level() > $_obInitialLevel_) {
                 if (!@ob_end_clean()) {
                     ob_clean();
                 }
    
共收到 3 条回复
Fecmall#12年前 0 个赞

如果升级,fecmall和fecro都需要升级

ivanye211#22年前 0 个赞

进不了后台,还有什么方法可以升级fecro

Fecmall#32年前 0 个赞

@ivanye211 #2楼 Fecmall的后台为什么进不去呢?

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics