Rita Ramos Posted January 12, 2021 Share Posted January 12, 2021 Has anyone had the same error? I went to update Prestashop 1.7.6 through 1-click to version 1.7.7 and I can't access the backoffice anymore because it presents this error in the debub: CRITICAL php Call to undefined method Currency :: getPattern () CRITICAL request Uncaught PHP Exception Symfony \ Component \ Debug \ Exception \ UndefinedMethodException: "Attempted to call an undefined method named" getPattern "of class" Currency "." at /home/thenatur/public_html/src/Core/Localization/Currency/DataLayer/CurrencyDatabase.php line 120 On backoffice page shows this: Oops... looks like an unexpected error occurred Attempted to call an undefined method named "getPattern" of class "Currency". [Symfony\Component\Debug\Exception\UndefinedMethodException 0] Link to comment Share on other sites More sharing options...
Prestachamps Posted January 12, 2021 Share Posted January 12, 2021 Hi, most probably you have an old module which is calling the getPattern() function from Currency class, which was hardcoded in your old class. to find the module you should activate debug mode and then on the Backoffice login page you will have the trace of this error. Kind regards, Leo Link to comment Share on other sites More sharing options...
Rita Ramos Posted January 12, 2021 Author Share Posted January 12, 2021 5 minutes ago, Leo @ Prestachamps said: Hi, most probably you have an old module which is calling the getPattern() function from Currency class, which was hardcoded in your old class. to find the module you should activate debug mode and then on the Backoffice login page you will have the trace of this error. Kind regards, Leo Hi, I have already entered the debug, as shown above. I went in the line of code and it appears this: And I don't know how to fix this error because I don't know what the correct syntax would be. Link to comment Share on other sites More sharing options...
joseantgv Posted January 12, 2021 Share Posted January 12, 2021 Could you upload a full screenshot of the error? Link to comment Share on other sites More sharing options...
Rita Ramos Posted January 12, 2021 Author Share Posted January 12, 2021 1 minute ago, joseantgv said: Could you upload a full screenshot of the error? On the backoffice Link to comment Share on other sites More sharing options...
joseantgv Posted January 12, 2021 Share Posted January 12, 2021 Enable DEBUG mode first Link to comment Share on other sites More sharing options...
Rita Ramos Posted January 12, 2021 Author Share Posted January 12, 2021 2 minutes ago, joseantgv said: Enable DEBUG mode first Sure...eheheheh UndefinedMethodException Symfony\Component\Debug\Exception\UndefinedMethodException: Attempted to call an undefined method named "getPattern" of class "Currency". at src/Core/Localization/Currency/DataLayer/CurrencyDatabase.php:120 at PrestaShop\PrestaShop\Core\Localization\Currency\DataLayer\CurrencyDatabase->doRead(object(LocalizedCurrencyId)) (src/Core/Data/Layer/AbstractDataLayer.php:90) at PrestaShop\PrestaShop\Core\Data\Layer\AbstractDataLayer->read(object(LocalizedCurrencyId)) (src/Core/Data/Layer/AbstractDataLayer.php:150) at PrestaShop\PrestaShop\Core\Data\Layer\AbstractDataLayer->propagateRead(object(LocalizedCurrencyId)) (src/Core/Data/Layer/AbstractDataLayer.php:94) at PrestaShop\PrestaShop\Core\Data\Layer\AbstractDataLayer->read(object(LocalizedCurrencyId)) (src/Core/Localization/Currency/CurrencyDataSource.php:67) at PrestaShop\PrestaShop\Core\Localization\Currency\CurrencyDataSource->getLocalizedCurrencyData(object(LocalizedCurrencyId)) (src/Core/Localization/Currency/CurrencyDataSource.php:110) at PrestaShop\PrestaShop\Core\Localization\Currency\CurrencyDataSource->formatCurrenciesData(array('EUR'), 'pt-PT') (src/Core/Localization/Currency/CurrencyDataSource.php:97) at PrestaShop\PrestaShop\Core\Localization\Currency\CurrencyDataSource->getAllInstalledCurrenciesData('pt-PT') (src/Core/Localization/Currency/Repository.php:87) at PrestaShop\PrestaShop\Core\Localization\Currency\Repository->getAllInstalledCurrencies('pt-PT') (src/Core/Localization/Locale/Repository.php:207) at PrestaShop\PrestaShop\Core\Localization\Locale\Repository->getPriceSpecifications('pt-PT') (src/Core/Localization/Locale/Repository.php:150) at PrestaShop\PrestaShop\Core\Localization\Locale\Repository->getLocale('pt-PT') (classes/controller/Controller.php:189) at ControllerCore->init() (classes/controller/AdminController.php:2782) at AdminControllerCore->init() (classes/controller/Controller.php:273) at ControllerCore->run() (classes/Dispatcher.php:515) at DispatcherCore->dispatch() (admin8943a56v4/index.php:97) Link to comment Share on other sites More sharing options...
astianax Posted February 4, 2021 Share Posted February 4, 2021 Prestashop and their crapy upgrades ... I've had the same issue, fixed by downloading the exact same version that I have on my website, deleted the src folder and replaced it with the fresh one ! Make a complete backup in case 1 Link to comment Share on other sites More sharing options...
notsureabout Posted February 21, 2021 Share Posted February 21, 2021 After a 1-click upgrade from 1.7.6.4 to 1.7.7.1 I have the same exact error as @Rita Ramos Replacing src folder didn't work for me. Couldn't find any working solution on the net. Maybe someone faced the same problem and solved can share his/her solution? Thanks Link to comment Share on other sites More sharing options...
joseantgv Posted February 21, 2021 Share Posted February 21, 2021 hace 3 horas, notsureabout dijo: After a 1-click upgrade from 1.7.6.4 to 1.7.7.1 I have the same exact error as @Rita Ramos Replacing src folder didn't work for me. Couldn't find any working solution on the net. Maybe someone faced the same problem and solved can share his/her solution? Thanks Could you please upload a screenshot from your error? Link to comment Share on other sites More sharing options...
notsureabout Posted February 22, 2021 Share Posted February 22, 2021 (edited) On 1/12/2021 at 5:45 PM, Rita Ramos said: UndefinedMethodException Symfony\Component\Debug\Exception\UndefinedMethodException: Attempted to call an undefined method named "getPattern" of class "Currency". at src/Core/Localization/Currency/DataLayer/CurrencyDatabase.php:120 at PrestaShop\PrestaShop\Core\Localization\Currency\DataLayer\CurrencyDatabase->doRead(object(LocalizedCurrencyId)) (src/Core/Data/Layer/AbstractDataLayer.php:90) at PrestaShop\PrestaShop\Core\Data\Layer\AbstractDataLayer->read(object(LocalizedCurrencyId)) (src/Core/Data/Layer/AbstractDataLayer.php:150) at PrestaShop\PrestaShop\Core\Data\Layer\AbstractDataLayer->propagateRead(object(LocalizedCurrencyId)) (src/Core/Data/Layer/AbstractDataLayer.php:94) at PrestaShop\PrestaShop\Core\Data\Layer\AbstractDataLayer->read(object(LocalizedCurrencyId)) (src/Core/Localization/Currency/CurrencyDataSource.php:67) at PrestaShop\PrestaShop\Core\Localization\Currency\CurrencyDataSource->getLocalizedCurrencyData(object(LocalizedCurrencyId)) (src/Core/Localization/Currency/CurrencyDataSource.php:110) at PrestaShop\PrestaShop\Core\Localization\Currency\CurrencyDataSource->formatCurrenciesData(array('EUR'), 'pt-PT') (src/Core/Localization/Currency/CurrencyDataSource.php:97) at PrestaShop\PrestaShop\Core\Localization\Currency\CurrencyDataSource->getAllInstalledCurrenciesData('pt-PT') (src/Core/Localization/Currency/Repository.php:87) at PrestaShop\PrestaShop\Core\Localization\Currency\Repository->getAllInstalledCurrencies('pt-PT') (src/Core/Localization/Locale/Repository.php:207) at PrestaShop\PrestaShop\Core\Localization\Locale\Repository->getPriceSpecifications('pt-PT') (src/Core/Localization/Locale/Repository.php:150) at PrestaShop\PrestaShop\Core\Localization\Locale\Repository->getLocale('pt-PT') (classes/controller/Controller.php:189) at ControllerCore->init() (classes/controller/AdminController.php:2782) at AdminControllerCore->init() (classes/controller/Controller.php:273) at ControllerCore->run() (classes/Dispatcher.php:515) at DispatcherCore->dispatch() (admin8943a56v4/index.php:97) Hi joseantgv, thanks for your interest. Right now I deleted all my experiments in localhost but my error is identical to Rita Ramos I quoted here. I tried several approaches: using different php versions, disabling custom theme before upgrading, checking currencies before upgrading and several other. I didn't get any error messages in BO after 1 click upgrade but the message I get after this operation is the one I enclose here. Website I'm trying to update is a 1.7.6.2 correctly upgraded to 1.7.6.4 several months ago. Thanks Edited February 22, 2021 by notsureabout (see edit history) Link to comment Share on other sites More sharing options...
astianax Posted February 22, 2021 Share Posted February 22, 2021 Hello, indeed, replacing the folder worked for a couple of minutes, then it's down again. The only solution I foud, is to install a fresh prestashop, move my images, my order/cutomers/cart tables et start on a fresh prestashop. The updates are so broken it's insane ... Link to comment Share on other sites More sharing options...
joseantgv Posted February 22, 2021 Share Posted February 22, 2021 hace 14 minutos, notsureabout dijo: Hi joseantgv, thanks for your interest. Right now I deleted all my experiments in localhost but my error is identical to Rita Ramos I quoted here. I tried several approaches: using different php versions, disabling custom theme before upgrading, checking currencies before upgrading and several other. I didn't get any error messages in BO after 1 click upgrade but the message I get after this operation is the one I enclose here. Website I'm trying to update is a 1.7.6.2 correctly upgraded to 1.7.6.4 several months ago. Thanks Please upload your error with the main error visible because in this screenshot it isn't. Link to comment Share on other sites More sharing options...
notsureabout Posted February 23, 2021 Share Posted February 23, 2021 22 hours ago, joseantgv said: Please upload your error with the main error visible because in this screenshot it isn't. Hi joseantgv, will retry un upgrade right now. but there's a new version 1.7.7.2 Will post errors if any. Thank you for your patience. Link to comment Share on other sites More sharing options...
notsureabout Posted February 23, 2021 Share Posted February 23, 2021 (edited) Ok, upgraded from 1.7.6.4 to 1.7.7.2 1-Click Upgrade php 7.3.9 Received these errors on admin login Received these errors in frontoffice Fatal error: Uncaught Error: Call to undefined method Currency::getPattern() in E:\laragon\www\spuzzapaolo2020_02_20\src\Core\Localization\Currency\DataLayer\CurrencyDatabase.php:120 Stack trace: #0 E:\laragon\www\spuzzapaolo2020_02_20\src\Core\Data\Layer\AbstractDataLayer.php(90): PrestaShop\PrestaShop\Core\Localization\Currency\DataLayer\CurrencyDatabase->doRead(Object(PrestaShop\PrestaShop\Core\Localization\Currency\LocalizedCurrencyId)) #1 E:\laragon\www\spuzzapaolo2020_02_20\src\Core\Data\Layer\AbstractDataLayer.php(150): PrestaShop\PrestaShop\Core\Data\Layer\AbstractDataLayer->read(Object(PrestaShop\PrestaShop\Core\Localization\Currency\LocalizedCurrencyId)) #2 E:\laragon\www\spuzzapaolo2020_02_20\src\Core\Data\Layer\AbstractDataLayer.php(94): PrestaShop\PrestaShop\Core\Data\Layer\AbstractDataLayer->propagateRead(Object(PrestaShop\PrestaShop\Core\Localization\Currency\LocalizedCurrencyId)) #3 E:\laragon\www\spuzzapaolo2020_02_20\src\Core\Localization\Currency\CurrencyDataSource.php(67): PrestaShop\PrestaShop\Core\Da in E:\laragon\www\spuzzapaolo2020_02_20\src\Core\Localization\Currency\DataLayer\CurrencyDatabase.php on line 120 Edited February 23, 2021 by notsureabout (see edit history) Link to comment Share on other sites More sharing options...
musicmaster Posted February 23, 2021 Share Posted February 23, 2021 (edited) Strange. There is a function getPattern() both in /classes/Currency.php and /src/Core/Localization/Currency.php. My guess would be that it has something to do with the table ps_currency_lang that was introduced in PS version 1.7.6. That table contains a field with the name pattern with usually the value NULL. Edited February 23, 2021 by musicmaster (see edit history) Link to comment Share on other sites More sharing options...
joseantgv Posted February 24, 2021 Share Posted February 24, 2021 PHP version? Link to comment Share on other sites More sharing options...
notsureabout Posted February 24, 2021 Share Posted February 24, 2021 3 hours ago, joseantgv said: PHP version? from 1.7.6.4 to 1.7.7.2 1-Click Upgrade php 7.3.9 Link to comment Share on other sites More sharing options...
rtruso Posted April 27, 2021 Share Posted April 27, 2021 Hello I have the same issue after migration attempt. Is there any solution to solve it ? Link to comment Share on other sites More sharing options...
notsureabout Posted April 27, 2021 Share Posted April 27, 2021 2 hours ago, rtruso said: Hello I have the same issue after migration attempt. Is there any solution to solve it ? Could not find a solution. Had to rebuild website from scratch... Link to comment Share on other sites More sharing options...
musicmaster Posted April 28, 2021 Share Posted April 28, 2021 19 hours ago, rtruso said: Hello I have the same issue after migration attempt. Is there any solution to solve it ? If you pm me access data (ftp and/or database) I will have a look. Link to comment Share on other sites More sharing options...
musicmaster Posted April 28, 2021 Share Posted April 28, 2021 Note that the pattern field was added to the ps_currency_lang table in version 1.7.7. I would expect that the main source of this kind of trouble is partial upgrades/restorations that result in a mix of 1.7.6 and 1.7.7 code. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now