FACT-Finder-Web-Components / magento2-module

FACT-Finder® Web Components for Magento 2
https://web-components.fact-finder.de/
Other
11 stars 17 forks source link

No region found within the locale 'de' #142

Closed fritzmg closed 5 years ago

fritzmg commented 5 years ago

If the Accept-Language request header only contains de, the following error will be generated:

1 exception(s):
Exception #0 (Zend_Currency_Exception): No region found within the locale 'de'

Exception #0 (Zend_Currency_Exception): No region found within the locale 'de'
<pre>#1 Zend_Currency->__construct(NULL, NULL) called at [vendor/magento/framework/Currency.php:27]
#2 Magento\Framework\Currency->__construct(&Magento\Framework\App\Cache\Proxy#0000000024459fac0000000022db8a70#, NULL, NULL) called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:111]
#3 Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\Framewor...', array(&Magento\Framework\App\Cache\Proxy#0000000024459fac0000000022db8a70#, NULL, NULL)) called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:66]
#4 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewor...') called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]
#5 Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewor...') called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:144]
#6 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(array('instance' => 'Magento\Framewor...'), 'Magento\Framewor...', NULL, 'currency', 'Omikron\Factfind...') called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230]
#7 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Omikron\Factfind...', array(array('scopeConfig', 'Magento\Framewor...', true, NULL), array('localeResolver', 'Magento\Framewor...', true, NULL), array('currency', 'Magento\Framewor...', true, NULL)), array()) called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]
#8 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Omikron\Factfind...', array(array('scopeConfig', 'Magento\Framewor...', true, NULL), array('localeResolver', 'Magento\Framewor...', true, NULL), array('currency', 'Magento\Framewor...', true, NULL)), array()) called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]
#9 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Omikron\Factfind...') called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]
#10 Magento\Framework\ObjectManager\ObjectManager->get('Omikron\Factfind...') called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:180]
#11 Magento\Framework\ObjectManager\Factory\AbstractFactory->parseArray(array('user' => &InspiredMinds\KastnerFactfinder\Model\SessionData#000000002445964e0000000022db8a70#, 'communication' => &Omikron\Factfinder\Model\Config\CommunicationConfig#000000002445964d0000000022db8a70#, 'behaviour' => &Omikron\Factfinder\Model\Config\Communication\BehaviourConfig#00000000244596420000000022db8a70#, 'personalization' => &Omikron\Factfinder\Model\Config\Communication\PersonalizationConfig#000000002445964c0000000022db8a70#, 'cache' => &Omikron\Factfinder\Model\Config\Communication\CacheConfig#000000002445964b0000000022db8a70#, 'currency' => array('instance' => 'Omikron\Factfind...'))) called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:156]
#12 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(array('user' => &InspiredMinds\KastnerFactfinder\Model\SessionData#000000002445964e0000000022db8a70#, 'communication' => &Omikron\Factfinder\Model\Config\CommunicationConfig#000000002445964d0000000022db8a70#, 'behaviour' => &Omikron\Factfinder\Model\Config\Communication\BehaviourConfig#00000000244596420000000022db8a70#, 'personalization' => &Omikron\Factfinder\Model\Config\Communication\PersonalizationConfig#000000002445964c0000000022db8a70#, 'cache' => &Omikron\Factfinder\Model\Config\Communication\CacheConfig#000000002445964b0000000022db8a70#, 'currency' => array('instance' => 'Omikron\Factfind...')), NULL, array(), 'parametersSource', 'Omikron\Factfind...') called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230]
#13 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Omikron\Factfind...', array(array('parametersSource', NULL, false, array())), array('parametersSource' => array('user' => array('instance' => 'Omikron\Factfind...'), 'communication' => array('instance' => 'Omikron\Factfind...'), 'behaviour' => array('instance' => 'Omikron\Factfind...'), 'personalization' => array('instance' => 'Omikron\Factfind...'), 'cache' => array('instance' => 'Omikron\Factfind...'), 'currency' => array('instance' => 'Omikron\Factfind...')))) called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]
#14 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Omikron\Factfind...', array(array('parametersSource', NULL, false, array())), array('parametersSource' => array('user' => array('instance' => 'Omikron\Factfind...'), 'communication' => array('instance' => 'Omikron\Factfind...'), 'behaviour' => array('instance' => 'Omikron\Factfind...'), 'personalization' => array('instance' => 'Omikron\Factfind...'), 'cache' => array('instance' => 'Omikron\Factfind...'), 'currency' => array('instance' => 'Omikron\Factfind...')))) called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]
#15 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Omikron\Factfind...') called at [vendor/magento/framework/ObjectManager/ObjectManager.php:70]
#16 Magento\Framework\ObjectManager\ObjectManager->get('Omikron\Factfind...') called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:144]
#17 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(array('instance' => 'Omikron\Factfind...'), 'Omikron\Factfind...', NULL, 'parametersProvid...', 'Omikron\Factfind...') called at [vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php:230]
#18 Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgumentsInRuntime('Omikron\Factfind...', array(array('fieldRoles', 'Omikron\Factfind...', true, NULL), array('serializer', 'Magento\Framewor...', true, NULL), array('parametersProvid...', 'Omikron\Factfind...', true, NULL)), array()) called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:34]
#19 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Omikron\Factfind...', array(array('fieldRoles', 'Omikron\Factfind...', true, NULL), array('serializer', 'Magento\Framewor...', true, NULL), array('parametersProvid...', 'Omikron\Factfind...', true, NULL)), array()) called at [vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php:59]
#20 Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Omikron\Factfind...', array()) called at [vendor/magento/framework/ObjectManager/ObjectManager.php:56]
#21 Magento\Framework\ObjectManager\ObjectManager->create('Omikron\Factfind...') called at [vendor/magento/framework/View/Layout/Argument/Interpreter/DataObject.php:48]
#22 Magento\Framework\View\Layout\Argument\Interpreter\DataObject->evaluate(array('name' => 'view_model', 'value' => 'Omikron\Factfind...')) called at [vendor/magento/framework/Data/Argument/Interpreter/Composite.php:61]
#23 Magento\Framework\Data\Argument\Interpreter\Composite->evaluate(array('name' => 'view_model', 'value' => 'Omikron\Factfind...')) called at [vendor/magento/framework/View/Layout/Argument/Interpreter/Decorator/Updater.php:47]
#24 Magento\Framework\View\Layout\Argument\Interpreter\Decorator\Updater->evaluate(array('name' => 'view_model', 'xsi:type' => 'object', 'value' => 'Omikron\Factfind...')) called at [vendor/magento/framework/View/Layout/Generator/Block.php:318]
#25 Magento\Framework\View\Layout\Generator\Block->evaluateArguments(array('view_model' => array('name' => 'view_model', 'xsi:type' => 'object', 'value' => 'Omikron\Factfind...'))) called at [vendor/magento/framework/View/Layout/Generator/Block.php:228]
#26 Magento\Framework\View\Layout\Generator\Block->generateBlock(&Magento\Framework\View\Layout\ScheduledStructure#00000000244596900000000022db8a70#, &Magento\Framework\View\Layout\Data\Structure#00000000244598090000000022db8a70#, 'factfinder.commu...') called at [vendor/magento/framework/View/Layout/Generator/Block.php:136]
#27 Magento\Framework\View\Layout\Generator\Block->process(&Magento\Framework\View\Layout\Reader\Context#00000000244596920000000022db8a70#, &Magento\Framework\View\Layout\Generator\Context#00000000244596ff0000000022db8a70#) called at [vendor/magento/framework/View/Layout/GeneratorPool.php:80]
#28 Magento\Framework\View\Layout\GeneratorPool->process(&Magento\Framework\View\Layout\Reader\Context#00000000244596920000000022db8a70#, &Magento\Framework\View\Layout\Generator\Context#00000000244596ff0000000022db8a70#) called at [vendor/magento/framework/View/Layout.php:343]
#29 Magento\Framework\View\Layout->generateElements() called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:89]
#30 Magento\Framework\View\Layout\Interceptor->generateElements() called at [vendor/magento/framework/View/Layout/Builder.php:129]
#31 Magento\Framework\View\Layout\Builder->generateLayoutBlocks() called at [vendor/magento/framework/View/Page/Builder.php:55]
#32 Magento\Framework\View\Page\Builder->generateLayoutBlocks() called at [vendor/magento/framework/View/Layout/Builder.php:65]
#33 Magento\Framework\View\Layout\Builder->build() called at [vendor/magento/framework/View/Layout.php:253]
#34 Magento\Framework\View\Layout->build() called at [vendor/magento/framework/View/Layout.php:875]
#35 Magento\Framework\View\Layout->getBlock('page_content_hea...') called at [generated/code/Magento/Framework/View/Layout/Interceptor.php:414]
#36 Magento\Framework\View\Layout\Interceptor->getBlock('page_content_hea...') called at [vendor/magento/module-cms/Helper/Page.php:171]
#37 Magento\Cms\Helper\Page->prepareResultPage(&Magento\Cms\Controller\Index\Index\Interceptor#00000000244599ff0000000022db8a70#, 'home') called at [vendor/magento/module-cms/Controller/Index/Index.php:68]
#38 Magento\Cms\Controller\Index\Index->execute(NULL) called at [generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php:24]
#39 Magento\Cms\Controller\Index\Index\Interceptor->execute() called at [vendor/magento/framework/App/Action/Action.php:107]
#40 Magento\Framework\App\Action\Action->dispatch(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#41 Magento\Cms\Controller\Index\Index\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#42 Magento\Cms\Controller\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#43 Magento\Cms\Controller\Index\Index\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#), array(array('designLoader', 'customerNotifica...', 'catalog_app_acti...', 'tax-app-action-d...', 'weee-app-action-...', 'storeCheck', 'contextPlugin', 'customer-app-act...'))) called at [generated/code/Magento/Cms/Controller/Index/Index/Interceptor.php:39]
#44 Magento\Cms\Controller\Index\Index\Interceptor->dispatch(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/framework/App/FrontController.php:55]
#45 Magento\Framework\App\FrontController->dispatch(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/framework/Interception/Interceptor.php:58]
#46 Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', array(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#)) called at [vendor/magento/framework/Interception/Interceptor.php:138]
#47 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/module-store/App/FrontController/Plugin/RequestPreprocessor.php:94]
#48 Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(&Magento\Framework\App\FrontController\Interceptor#0000000024459e5d0000000022db8a70#, &Closure#0000000024459e470000000022db8a70#, &Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#49 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/module-page-cache/Model/App/FrontController/BuiltinPlugin.php:69]
#50 Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(&Magento\Framework\App\FrontController\Interceptor#0000000024459e5d0000000022db8a70#, &Closure#0000000024459e470000000022db8a70#, &Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/framework/Interception/Interceptor.php:135]
#51 Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/framework/Interception/Interceptor.php:153]
#52 Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', array(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#), array(array('inspiredminds.ka...'))) called at [generated/code/Magento/Framework/App/FrontController/Interceptor.php:26]
#53 Magento\Framework\App\FrontController\Interceptor->dispatch(&Magento\Framework\App\Request\Http#0000000024459e310000000022db8a70#) called at [vendor/magento/framework/App/Http.php:136]
#54 Magento\Framework\App\Http->launch() called at [generated/code/Magento/Framework/App/Http/Interceptor.php:24]
#55 Magento\Framework\App\Http\Interceptor->launch() called at [vendor/magento/framework/App/Bootstrap.php:257]
#56 Magento\Framework\App\Bootstrap->run(&Magento\Framework\App\Http\Interceptor#0000000024459e700000000022db8a70#) called at [pub/index.php:37]

Seems to happen during the generation of the <ff-communication> block.

fritzmg commented 5 years ago

It seems the currency-code is dependent on the Accept-Language for some reason. During testing for https://github.com/FACT-Finder-Web-Components/magento2-module/issues/140 I noticed that the ff-communication block is generated with the following information:

<ff-communication currency-code="GBP" currency-country-code="de-DE" />

when using the following Accept-Language request header:

Accept-Language: en-GB,en;q=0.8,de-AT;q=0.5,de;q=0.3

and

<ff-communication currency-code="EUR" currency-country-code="de-DE" />

when using the following Accept-Language request header:

Accept-Language: de-AT,de;q=0.8,en-GB;q=0.5,en;q=0.3

The currency-country-code is using the correct language setting from the store configuration - but why is the currency-code dependent on the Accept-Language rather than the store configuration? It should be EUR, not GBP for our store.

a-laurowski commented 5 years ago

hi @fritzmg. Fix is already on Pull requests

fritzmg commented 5 years ago

Thank you. Do you have https://github.com/FACT-Finder-Web-Components/magento2-module/pull/84#issuecomment-509244099 in your pipeline yet as well? This feature is really important for us.