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
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.
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?
Hello @jorge_russo
whatever file mention in last msg it is calling from that.
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.
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
Hello @jorge_russo
It mostly happens due to some extension attribute with custom source model.
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
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?
Hello @jorge_russo
Disable compiler and add that function to that file and check it.
If work then marks as solution.