After add a product to the cart, if I change the quantity, and update cart, I get this notice but the change it's applied:

Notice: Undefined property: Drupal\views\Form\ViewsForm::$quantityPrices in Drupal\commerce_xquantity\Entity\XquantityOrderItem->getQuantityPrice() (line 197 of modules/contrib/commerce_xquantity/src/Entity/XquantityOrderItem.php).

Drupal\commerce_xquantity\Entity\XquantityOrderItem->getQuantityPrice(Object, Object, '2') (Line: 145)
Drupal\commerce_xquantity\Plugin\views\field\XquantityEditQuantity->viewsFormSubmit(Array, Object) (Line: 132)
Drupal\views\Form\ViewsFormMainForm->submitForm(Array, Object) (Line: 187)
Drupal\views\Form\ViewsForm->submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 590)
Drupal\Core\Form\FormBuilder->processForm('views_form_commerce_cart_form_default_1', Array, Object) (Line: 319)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 217)
Drupal\Core\Form\FormBuilder->getForm(Object, Object, Array) (Line: 2206)
Drupal\views\Plugin\views\display\DisplayPluginBase->elementPreRender(Array)
call_user_func(Array, Array) (Line: 378)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array) (Line: 450)
Drupal\Core\Render\Renderer->doRender(Array, ) (Line: 195)
Drupal\Core\Render\Renderer->render(Array, ) (Line: 226)
Drupal\Core\Render\MainContent\HtmlRenderer->Drupal\Core\Render\MainContent\{closure}() (Line: 582)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 227)
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: 67)
Drupal\simple_oauth\HttpMiddleware\BasicAuthSwap->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: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->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: 693)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

I have many modules and customizations in the project, but I adding commerce now, it's with default settings.

CommentFileSizeAuthor
#2 3101813-2.patch715 bytespsf_

Comments

psf_ created an issue. See original summary.

psf_’s picture

Status: Active » Needs review
StatusFileSize
new715 bytes

  • drugan committed 1018c36 on 8.x-1.x authored by psf_
    Issue #3101813 by psf_: PHP Notice changing product quantity
    
drugan’s picture

Version: 8.x-1.0-beta7 » 8.x-1.x-dev
Status: Needs review » Reviewed & tested by the community

It was just a day before we've fixed the undefined quantityPrices property issue but somehow forgotten to test it along with order items which has no quantity price adjusments:

https://www.drupal.org/project/commerce_xquantity/issues/3081003#comment...

Thank you for the patch!

I'll wait a couple of days to see whether there someone else will come reporting issues after to the Drupal core 8.8.0 and Drupal Commerce 8.x-2.16 update and then move that change to the beta8 release.

drugan’s picture

drugan’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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