Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error 500 lesti fpc update to 1.4.8 #332

Open
mbensoussan opened this issue Oct 13, 2018 · 8 comments
Open

error 500 lesti fpc update to 1.4.8 #332

mbensoussan opened this issue Oct 13, 2018 · 8 comments

Comments

@mbensoussan
Copy link

Hi,
after a big update :

magento version 1.9.3.10
php : 7.2.11
lesti_fpc : 1.4.8

when i turn on lesti_fpc in the cache management, all my website show me an error 500.

you can see the erro bellow, if you have an idea...

Fatal error: Uncaught Error: Call to undefined method Lesti_Fpc_Helper_Data::getContentType() in
/var/www/clients/client1/web1/web/magento/app/code/community/Lesti/Fpc/Model/Observer.php:137 Stack trace:
#0 /var/www/clients/client1/web1/web/magento/app/code/core/Mage/Core/Model/App.php(1358): Lesti_Fpc_Model_Observer->httpResponseSendBefore(Object(Varien_Event_Observer))
#1 /var/www/clients/client1/web1/web/magento/app/code/core/Mage/Core/Model/App.php(1337): Mage_Core_Model_App->_callObserverMethod(Object(Lesti_Fpc_Model_Observer), 'httpResponseSen...', Object(Varien_Event_Observer)) #2 /var/www/clients/client1/web1/web/magento/app/Mage.php(451): Mage_Core_Model_App->dispatchEvent('http_response_s...', Array)
#3 /var/www/clients/client1/web1/web/magento/app/code/core/Mage/Core/Controller/Response/Http.php(83): Mage::dispatchEvent('http_response_s...', Array)
#4 /var/www/clients/client1/web1/web/magento/app/code/core/Mage/Core/Controller/Varien/Front.php(184): Mage_Core_Controller_Response_Http->sendResponse()
#5 /var/www in /var/www/clients/client1/web1/web/magento/app/code/community/Lesti/Fpc/Model/Observer.php on line 137

@GordonLesti
Copy link
Owner

GordonLesti commented Oct 13, 2018

Dear @mbensoussan
I guess something went wrong with your update. The method Lesti_Fpc_Helper_Data::getContentType exists and it is callable. Please double check if the code in your shop matches with the one at Github.

Best Regards
Gordon

@mbensoussan
Copy link
Author

mbensoussan commented Oct 14, 2018

yes i confirm all the files are the same,,
If i comment the line bellow (observer line 137), the website work again

            /*$this->_getFpc()->save(
                new Lesti_Fpc_Model_Fpc_CacheItem($body, time(), Mage::helper('fpc')->getContentType($response)),
                $key,
                $this->_cacheTags
            );*/

i continu my investigation... but for the moment i don't understand.

@mbensoussan
Copy link
Author

the bug come from this line :
new Lesti_Fpc_Model_Fpc_CacheItem($body, time(), Mage::helper('fpc')->getContentType($response)),

if i replace with :
new Lesti_Fpc_Model_Fpc_CacheItem($body, time(), 'text/html; charset=UTF-8'),

the website work, but it's not the solution.

@mbensoussan
Copy link
Author

mbensoussan commented Oct 14, 2018

ok so,

when the function :

public function getContentType(\Mage_Core_Controller_Response_Http $response)
{
foreach ($response->getHeaders() as $header) {
if (isset($header['name']) && $header['name'] === 'Content-Type' && isset($header['value'])) {
return $header['value'];
}
}
return 'text/html; charset=UTF-8';
}

is in lesti/fpc/helper/data.php, it's like magento don't found him

but if i copy paste the function in lesti/fpc/helper/abstract.php it's work and i have no error.

so i think the files lesti/fpc/helper/data.php don't extends Lesti_Fpc_Helper_Abstract.

why ... for the moment i don't know.

@mbensoussan
Copy link
Author

mbensoussan commented Oct 14, 2018

i really don't understand what happen, if you have an idea ?

@GordonLesti
Copy link
Owner

Did you made sure that your Magento version runs fine with PHP 7.2? https://community.magento.com/t5/News-Announcements/PHP-7-2-Support-Patches-for-Magento-1-are-now-available/td-p/106999

@mbensoussan
Copy link
Author

yes, i have make a big test from all the website.
i will found the solution ..

perhaps i can now if the abstract class is instantiate ?

@mbensoussan
Copy link
Author

all it's work..
i'm just so bad.

i forgot that i have make a surchage in the local directory about the helper data...

sorry for the time. and thank's for you module, it's make a really good job !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants