Closed afxgroup closed 4 months ago
Hello @afxgroup,
Thanks for your feedback.
The class PrestaShop\Module\Mbo\Addons\ApiClient
is instantiated through Symfony services, and maybe something is missing or is not well initialized before the call.
- method: setDefaultParams
arguments:
- "@=service('translator').getLocale()"
- "@=service('prestashop.adapter.data_provider.country').getIsoCodebyId()"
- "@=service('prestashop.adapter.legacy.configuration').get('_PS_BASE_URL_')"
- "@=service('prestashop.core.foundation.version').getSemVersion()"
Some questions :
In the meantime, we try to reproduce it.
Yes, i've cleared the cache several times of course
PHP version 7.4.33 on nginx
This is my addons.yml:
_defaults:
public: true
# Addons API Client
mbo.addons.client.api:
class: PrestaShop\Module\Mbo\Addons\ApiClient
arguments:
- "@mbo.addons.client.http"
calls:
- method: setDefaultParams
arguments:
- "@=service('translator').getLocale()"
- "@=service('prestashop.adapter.data_provider.country').getIsoCodebyId()"
- "@=service('prestashop.adapter.legacy.configuration').get('_PS_BASE_URL_')"
- "@=service('prestashop.core.foundation.version').getSemVersion()"```
It seems upgraded from version 2.33 (if I remember correctly) to 3.1.1
Thanks !
Strange behavior, we are trying to reproduce or search how this can happen.
@afxgroup We tried to reproduce it, but with no success :(
https://github.com/PrestaShopCorp/ps_mbo/assets/1721887/5c677828-313b-47eb-b3f8-be0daca4d49f
Can you try to dump somewhere the values of the needed arguments ?
As we don't have any news, I close the issue.
Feel free to reopen it if needed, or open another if you find something else.
Thanks !
Hello @afxgroup
Very long time ago, you opened this bug, and we unfortunately did not find a solution.
But today, we found the root cause.
Your user in back-office (table ps_employee
) may have a value in id_lang
that was not present in the table ps_lang
.
So the default param @=service('translator').getLocale()
was null.
Some other features in the BO should not have worked as expected in this case (maybe silent errors, less visible).
Thanks for reply i've checked the languages and the problem was in a language no more in DB However i get this error now on Marketplace:
Oh no.. something went wrong There has been a problem on our side. Refresh your page and if the problem persists, try again later.
While: Modules in the spotlight] Has no problem
@afxgroup
You can try to reset the module, maybe, the language problem causes another problem on the installation process.
That did the trick. Thank you
Glad we could finally help you! Thank you for your patience 🙏
I've updated ps_mbo to the latest version available for prestashop 1.7.8 and now the admin panel doesn't work anymore. I get this error:
PrestaShop\Module\Mbo\Addons\ApiClient::setDefaultParams() must be of the type string, null given, called in appProdProjectContainer.php on line 3494
And the only way to enter in backoffice is to delete the module from db, delete the cache and force AdminModulesCatalog as controller in marketplace. Any hint?