When viewing the current default currency, and the default is also the conversion source, I'm now seeing lots of warnings like the following:

Notice: Undefined index: GBP in Drupal\commerce_currency_resolver\CurrencyHelper::priceConversion() (line 184 of modules/contrib/commerce_currency_resolver/src/CurrencyHelper.php).
Drupal\commerce_currency_resolver\CurrencyHelper::priceConversion(Object, 'GBP') (Line: 90)
Drupal\commerce_shipping\ShipmentOrderProcessor->process(Object) (Line: 155)
Drupal\commerce_order\OrderRefresh->refresh(Object) (Line: 92)
Drupal\commerce_order\OrderStorage->doPreSave(Object) (Line: 389)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 820)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 391)
Drupal\Core\Entity\Entity->save() (Line: 114)
Drupal\commerce_order\OrderStorage->postLoad(Array) (Line: 249)
Drupal\Core\Entity\EntityStorageBase->loadMultiple(Array) (Line: 231)
Drupal\commerce_cart\CartProvider->loadCartData(Object) (Line: 184)
Drupal\commerce_cart\CartProvider->getCartIds(NULL) (Line: 172)
Drupal\commerce_cart\CartProvider->getCarts() (Line: 221)
Drupal\commerce_cart\Plugin\Block\CartBlock->getCacheTags() (Line: 86)
Drupal\block\BlockViewBuilder->viewMultiple(Array, 'full', NULL) (Line: 71)
Drupal\block\BlockViewBuilder->view(Object) (Line: 151)
Drupal\block\Plugin\DisplayVariant\BlockPageVariant->build() (Line: 259)
Drupal\Core\Render\MainContent\HtmlRenderer->prepare(Array, Object, Object) (Line: 117)
Drupal\Core\Render\MainContent\HtmlRenderer->renderResponse(Array, Object, Object) (Line: 90)
Drupal\Core\EventSubscriber\MainContentViewSubscriber->onViewRenderArray(Object, 'kernel.view', Object)
call_user_func(Array, Object, 'kernel.view', Object) (Line: 111)
Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('kernel.view', Object) (Line: 156)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 52)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 666)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

Comments

orphans created an issue. See original summary.

mattjones86’s picture

StatusFileSize
new543 bytes

  • valic committed 11a1f92 on 8.x-1.x authored by orphans
    Issue #2985085 by orphans: Warnings when viewing default currency
    
valic’s picture

Status: Active » Fixed

The issue is probably with setting conversion rates. In the last release is changed hot currencies are saved. The array should be always there.

But again, it's good coding practice if exist something before using.
Committed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.