[SOLVED] Locale object not available
Forum rules
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your TYPO3, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
[SOLVED] Locale object not available
Hi all,
when logging out of TYPO3 (9.5.9, aimeos 18.10.9) I get a
This doesn´t happen when I´m logging out from a page with shop plugins installed on. Is it a problem with my setup or have I found a real issue?
Best
Robert.
when logging out of TYPO3 (9.5.9, aimeos 18.10.9) I get a
Code: Select all
(1/1) Aimeos\MShop\Exception
Locale object not available
in /var/www/clients/client18/web67/web/typo3conf/ext/aimeos/Resources/Libraries/aimeos/aimeos-core/lib/mshoplib/src/MShop/Context/Item/Standard.php line 354
*/
public function getLocale()
{
if( !isset( $this->locale ) ) {
throw new \Aimeos\MShop\Exception( sprintf( 'Locale object not available' ) );
}
return $this->locale;
}
Best
Robert.
Last edited by boettner on 10 Oct 2019, 15:47, edited 1 time in total.
Re: Locale object not available
Seems to be introduced by this contribution:
https://github.com/aimeos/aimeos-typo3/ ... 6323c75de8
There's probably the Aimeos configuration missing on the other pages. Does assigning the Aimeos TS to the root page fixes the problem?
https://github.com/aimeos/aimeos-typo3/ ... 6323c75de8
There's probably the Aimeos configuration missing on the other pages. Does assigning the Aimeos TS to the root page fixes the problem?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Locale object not available
The Aimeos static TS and our custom TS for Aimeos is present on the root page.
Re: Locale object not available
Does is work if you replace the logout function (https://github.com/aimeos/aimeos-typo3/ ... e.php#L271) using this code:
Code: Select all
$context = self::getContext( self::getConfig() );
$context->setLocale( self::getLocale( $context ) );
\Aimeos\Controller\Frontend::create( $context, 'basket' )->clear();
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: Locale object not available
Yes, but for 18.10.9 it has to be:
Thanks for your ultra-fast help!
Code: Select all
$context = self::getContext( self::getConfig() );
$context->setLocale( self::getLocale( $context ) );
\Aimeos\Controller\Frontend\Factory::createController( $context, 'basket' )->clear();
Re: [SOLVED] Locale object not available
Ultra fast e-commerce, ultra fast help
I've seen that there's already another fix for that in 2018.10 branch using that code:
Can you use 2018.10.x-dev and test if that works too?
I've seen that there's already another fix for that in 2018.10 branch using that code:
Code: Select all
$session = self::getContext( self::getConfig() )->getSession();
foreach( $session->get( 'aimeos/basket/cache', [] ) as $key => $value ) {
$session->set( $key, null );
}
foreach( $session->get( 'aimeos/basket/list', [] ) as $key => $value ) {
$session->set( $key, null );
}
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
Re: [SOLVED] Locale object not available
Yes, can confirm it working with the the snippet only.
I will yet have to do a test with the whole 2018.10.x-dev package though. Will report back when done but it will be next week. This is just for a quick reply.
I will yet have to do a test with the whole 2018.10.x-dev package though. Will report back when done but it will be next week. This is just for a quick reply.