Attempt to assign property "currency_locale" on null

  • Posts: 43
  • Thank you received: 3
9 months 13 hours ago #359270

-- HikaShop version -- : 5.0.2
-- Joomla version -- : 5.0.2
-- PHP version -- : 8.1.13
-- Browser(s) name and version -- : firefox
-- Error-message(debug-mod must be tuned on) -- : An error has occurred.

0 Attempt to assign property "currency_locale" on null

Call Stack
# Function Location
1 () JROOT\administrator\components\com_hikashop\classes\currency.php:2935
2 hikashopCurrencyClass->checkLocale() JROOT\administrator\components\com_hikashop\classes\currency.php:53
3 hikashopCurrencyClass->get() JROOT\administrator\components\com_hikashop\classes\currency.php:2278
4 hikashopCurrencyClass->save() JROOT\administrator\components\com_hikashop\classes\config.php:117
5 hikashopConfigClass->save() JROOT\administrator\components\com_hikashop\controllers\config.php:87
6 ConfigController->store() JROOT\administrator\components\com_hikashop\controllers\config.php:33
7 ConfigController->apply() JROOT\libraries\src\MVC\Controller\BaseController.php:730
8 Joomla\CMS\MVC\Controller\BaseController->execute() JROOT\administrator\components\com_hikashop\helpers\helper.php:2554
9 hikashopController->execute() JROOT\administrator\components\com_hikashop\hikashop.php:73
10 require_once() JROOT\libraries\src\Dispatcher\LegacyComponentDispatcher.php:71
11 Joomla\CMS\Dispatcher\LegacyComponentDispatcher::Joomla\CMS\Dispatcher\{closure}() JROOT\libraries\src\Dispatcher\LegacyComponentDispatcher.php:73
12 Joomla\CMS\Dispatcher\LegacyComponentDispatcher->dispatch() JROOT\libraries\src\Component\ComponentHelper.php:361
13 Joomla\CMS\Component\ComponentHelper::renderComponent() JROOT\libraries\src\Application\AdministratorApplication.php:150
14 Joomla\CMS\Application\AdministratorApplication->dispatch() JROOT\libraries\src\Application\AdministratorApplication.php:195
15 Joomla\CMS\Application\AdministratorApplication->doExecute() JROOT\libraries\src\Application\CMSApplication.php:306
16 Joomla\CMS\Application\CMSApplication->execute() JROOT\administrator\includes\app.php:58
17 require_once() JROOT\administrator\index.php:32

Hi,
I got an error while saving the hikashop configuration in the administrator area, the error is " Attempt to assign property "currency_locale" on null ",
what should I do to fix this problem?
Thanks in advance

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 months 9 hours ago #359278

Hi,

This indicates that something is trying to load the data of a currency based on its currency code, but the currency entry in the hikashop_currency table in the database doesn't exist.
It could be the case if, for example, you migrated the hikashop_config table where the main currency setting value is stored, while not migrating the hikashop_currency table, and that you previously had created a custom currency via the menu System>Currencies and you were using it as you main currency.
Or more simply, if you were using a currency as main currency and then you either deleted it, or changed its currency code via the System>Currencies menu.
So basically, that's something which should not happen normally.
Add the code:

		if(empty($element))
			return;
after the line:
		function checkLocale(&$element) {
in the file administrator/components/com_hikashop/classes/currency.php and it should prevent the error.
We'll include the change for the next version of HikaShop.

The following user(s) said Thank You: diacotm

Please Log in or Create an account to join the conversation.

  • Posts: 43
  • Thank you received: 3
9 months 7 hours ago #359281

Wonderful!
It's worked!
Thanks so much

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum