X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Have problem with product varient module (https://forum.x-cart.com/showthread.php?t=75540)

ajeetsingh 07-26-2017 02:07 AM

Have problem with product varient module
 
Hello,

We have a module name pre-order for x-cart 5.3.3.1,
When i installed that module and after enabled i go to the product page at backend, then click on any product ad go to details page, There i find that A new tab "Preorder" is available. When i click on that tab then it's page are working but i have a problem that when i Click on "Product variant" Tab the it throw an error as below :

HTML Code:


ERROR: "Includes\ErrorHandler::FATAL_ERROR" (code 2)
Call to a member function toArray() on null


and when i uninstalled preorder module that that "Product Variant" tab is working fine.


The code for the "Pre-order" module at path to call the preorder page is as below

classes/XLite/Module/Wevbkulsoftware/PreorderSales/Controller/Admin/Product.php

PHP Code:

/**
     * Page key
     */
    
const PAGE_VARI 'preorders';


public function 
getPages()
    {
        
$list parent::getPages();

        if (!
$this->isNew()) {
            
$list array_merge(
                
array_slice($list05),
                array(static::
PAGE_VARI => static::t('PreorderSales')),
                
array_slice($list5)
            );
        }

        return 
$list;
    }



protected function 
getPageTemplates()
    {
        
$list parent::getPageTemplates();

        if (!
$this->isNew()) {
            
$list array_merge(
                
array_slice($list0,5),
                array(static::
PAGE_VARI => 'modules/Webkulsoftware/PreorderSales/preorders/body.twig'),
                
array_slice($list5)
            );
        }

        return 
$list;
    } 



And code for the module "Product variant" at path below
classes/XLite/Module/XC/ProductVariants/Controller/Admin/Product.php

is

PHP Code:

/**
     * Page key
     */
    
const PAGE_VARIANTS 'variants';
/**
     * Get pages
     *
     * @return array
     */
    
public function getPages()
    {
        
$list parent::getPages();

        if (!
$this->isNew()) {
            
$list array_merge(
                
array_slice($list02),
                array(static::
PAGE_VARIANTS => static::t('Variants')),
                
array_slice($list2)
            );
        }

        return 
$list;
    }

    
/**
     * Get pages templates
     *
     * @return array
     */
    
protected function getPageTemplates()
    {
        
$list parent::getPageTemplates();

        if (!
$this->isNew()) {
            
$list array_merge(
                
array_slice($list02),
                array(static::
PAGE_VARIANTS => 'modules/XC/ProductVariants/variants/body.twig'),
                
array_slice($list2)
            );
        }

        return 
$list;
    } 


So, Please let me know the possible reason.

tony_sologubov 07-26-2017 05:24 AM

Re: Have problem with product varient module
 
Hi @ajeetsingh,

Can you show backtrace for this fatal error? It should specify the file and exact line where toArray() method is called on null instead of object.

Thank you.

Tony

ajeetsingh 07-26-2017 05:53 AM

Re: Have problem with product varient module
 
3 Attachment(s)
Hello @tony_sologubov

I will send you some screen shot where that problems occurs. Please check it.
Attachment 4969

Attachment 4970

Attachment 4971

ajeetsingh 07-30-2017 10:30 PM

Re: Have problem with product varient module
 
Hi @tony_sologubov ,

Can you please suggest me about my query. I am waiting for your response.

Thank You.

qualiteam 07-31-2017 12:46 AM

Re: Have problem with product varient module
 
Quote:

when i uninstalled preorder module that that "Product Variant" tab is working fine
Quote:

.../Wevbkulsoftware/PreorderSales/...

I'm not sure, but it may be a bug in PreoredSales module.
Did you contact the module author?
https://webkul.com/contacts/

ajeetsingh 07-31-2017 10:30 PM

Re: Have problem with product varient module
 
Hi,

If the issue is from pre-order then can you please suggest me the reason of that issue. so that i will able to fix it.

qualiteam 08-01-2017 02:38 AM

Re: Have problem with product varient module
 
Ah. I apologize. I missed the fact that you are from Webkul.

Code:

ERROR: "Includes\ErrorHandler::FATAL_ERROR" (code 2)
Call to a member function toArray() on null


This is not enough to guess why this may happen. Please check the log files in the var/log/ directory for the full text of the error message including the complete backtrace to the file and the line where it happens.

ajeetsingh 08-01-2017 03:00 AM

Re: Have problem with product varient module
 
4 Attachment(s)
Hi @qualiteam,

Now i am sending you the files on path var/log/2017

Please check it.

Attachment 4988

Attachment 4989

Attachment 4990

Attachment 4991

Thank You.

tony_sologubov 08-03-2017 05:46 AM

Re: Have problem with product varient module
 
@ajeetsingh,

Judging by error messages in the log, there is a problem on 107 line in the classes/XLite/Module/Wevbkulsoftware/PreorderSales/Controller/Admin/Product.php file and I assume that the code you quoted earlier is correct:
Code:

/**
    * Page key
    */
    const PAGE_VARI = 'preorders';


public function getPages()
    {
        $list = parent::getPages();

        if (!$this->isNew()) {
            $list = array_merge(
                array_slice($list, 0, 5),
                array(static::PAGE_VARI => static::t('PreorderSales')),
                array_slice($list, 5)
            );
        }

        return $list;
    }



protected function getPageTemplates()
    {
        $list = parent::getPageTemplates();

        if (!$this->isNew()) {
            $list = array_merge(
                array_slice($list, 0,5),
                array(static::PAGE_VARI => 'modules/Webkulsoftware/PreorderSales/preorders/body.twig'),
                array_slice($list, 5)
            );
        }

        return $list;
    } 


Could you please show the full code of that file?

Tony

ajeetsingh 08-03-2017 06:06 AM

Re: Have problem with product varient module
 
1 Attachment(s)
Quote:

Originally Posted by tony_sologubov
@ajeetsingh,

Judging by error messages in the log, there is a problem on 107 line in the classes/XLite/Module/Wevbkulsoftware/PreorderSales/Controller/Admin/Product.php file and I assume that the code you quoted earlier is correct:
Code:

/**
    * Page key
    */
    const PAGE_VARI = 'preorders';


public function getPages()
    {
        $list = parent::getPages();

        if (!$this->isNew()) {
            $list = array_merge(
                array_slice($list, 0, 5),
                array(static::PAGE_VARI => static::t('PreorderSales')),
                array_slice($list, 5)
            );
        }

        return $list;
    }



protected function getPageTemplates()
    {
        $list = parent::getPageTemplates();

        if (!$this->isNew()) {
            $list = array_merge(
                array_slice($list, 0,5),
                array(static::PAGE_VARI => 'modules/Webkulsoftware/PreorderSales/preorders/body.twig'),
                array_slice($list, 5)
            );
        }

        return $list;
    } 


Could you please show the full code of that file?

Tony



Hi @tony_sologubov,

I have send you the file please check the full code of that file.

Attachment 4994

Thank You for your reply.


All times are GMT -8. The time now is 12:52 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.