cancel
Showing results for 
Search instead for 
Did you mean: 

Magento search page return 500 error and blank page

Magento search page return 500 error and blank page

Hello,

I have enabled this two params in Magento:

-Use Flat Catalog Category

-Use Flat Catalog Product

After that, I have reindexed all products, and then, the website started to go faster.

 

The problem is when I try to search, I get 500 erro blank page and in the log appear this message:

 

PHP Fatal error: Call to undefined method Mage_Catalog_Model_Resource_Product_Flat::getEntityTablePrefix() in httpdocs/includes/src/__default.php on line 44543

 

Does someone know how to fix this error? After enabled these settings, and indexed all products, I have to make something more? 

 

Thank you,

Regards

9 REPLIES 9

Re: Magento search page return 500 error and blank page

Hello,

 

File: app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php
public function getBackendTable()
{
    if ($this->_dataTable === null) {
        if ($this->isStatic()) {            $this->_dataTable = $this->getEntityType()->getValueTablePrefix();
        } else {            $backendTable = trim($this->_getData('backend_table'));
            if (empty($backendTable)) {                $entityTable  = array($this->getEntity()->getEntityTablePrefix(), $this->getBackendType());                $backendTable = $this->getResource()->getTable($entityTable);
            }            $this->_dataTable = $backendTable;
        }
    }
    return $this->_dataTable;
}

there are some attribute created by some module,and it is try to find entity for that, so you need to debug code into above file.

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Magento search page return 500 error and blank page

Hello,

 

Thank you for your fast reply, I knew where is the error, and where is the file and I it says that this model Mage_Catalog_Model_Resource_Product_Flat doesn t have this method getEntityTablePrefix. And it s not in the file you say 

app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php

 Or you  mean that I have to add the function to the above file? 

Re: Magento search page return 500 error and blank page

Hello @jorge_russo

 

whatever file mention in last msg it is calling from that.

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Magento search page return 500 error and blank page

Hello @jorge_russo

 

if you are not able to debug it, add that function to that file and return empty value if no any db prefix.

 

if helpful then give kudos or mark as solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Magento search page return 500 error and blank page

Hello @Sunil Patel,

 

I m able to debug it, but usually I don t work with Magento and I don t want to break something else like now. That I change one setting inside Magento, and it breaks other thing. But, It doesnt matter, I try tonight and if it s work I write your answer as valid.

 

I cannot believe that for one change in config you can break other thing easily...

 

Thank you

Re: Magento search page return 500 error and blank page

Hello @jorge_russo

 

It mostly happens due to some extension attribute with custom source model.

 

 


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer

Re: Magento search page return 500 error and blank page

Hello @Sunil Patel,

 

I have tried what you wrote me, but It doesn t work, I return '', but It doesn t work. Have you got any other idea? 

 

It says the same error, but it comes from the file I wrote at the begining not what you wrote right?

 

Thank you

Re: Magento search page return 500 error and blank page

Hi @jorge_russo,

 

It seems you're using the compiler.

Can you try disabling it?

 

The easier way should be using the Magento shell (classes).
Go to the shell directory (into your magento root) and then run:

php compiler.php state


Now you'll see the current status of or compiler. If is enabled and/or compiled, please, execute this commands:

 

php compiler.php disable
php compiler.php clear


Now is disabled and you've cleared all the generated files.

Can you try it and check if the error is still happening?

Re: Magento search page return 500 error and blank page

Hello @jorge_russo

 

Disable compiler and add that function to that file and check it.

 

If work then marks as solution.


Problem solved? Click Kudos & Accept as Solution!
Sunil Patel
Magento 2 Certified Professional Developer & Frontend Developer