Upon checking out a product ($0.00) using Free Payment with a Role Assignment I immediately get a white screen saying "website experienced an unexpected error".
The user however, is created, but no email is sent. No transaction is logged.
Looking at the reports I find the following:
Recoverable fatal error: Argument 1 passed to _editor_get_file_uuids_by_field() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /Users/mattsaunders/Documents/drupal8/core/modules/editor/editor.module on line 367 and defined in _editor_get_file_uuids_by_field() (line 465 of /Users/mattsaunders/Documents/drupal8/core/modules/editor/editor.module).
I'm running Drupal 8.0.5, a fairly fresh install without many other modules at all (I'm in the process of trialling Ubercart).
Comment | File | Size | Author |
---|---|---|---|
#12 | 2695639-nested-order-save.patch | 2.98 KB | longwave |
| |||
#12 | 2695639-nested-order-save-test-only.patch | 2.1 KB | longwave |
#7 | nested-order-save.patch | 899 bytes | longwave |
|
Comments
Comment #2
webbymatt CreditAttribution: webbymatt commentedI found out what was causing this - my product was set to £0.00 because I wanted to test without payment.
Instead, I enabled the Payment Pack module, and added Cash on Delivery as a method. Then I changed the product to £10.00 and went through the process again - no error this time, and the user was created successfully.
Comment #3
TR CreditAttribution: TR commentedYes, there appears to be a problem with zero-price products, but this is not related to roles. I was able to get to the review page /cart/checkout/review, but when I submit the order I get a whitescreen with that same message, and the same error in the dblog. The order IS placed (using the Free order payment method), and the order details at /admin/store/orders/{uc_order} are correct.
Comment #4
longwaveI was unable to reproduce this with the steps provided. I have editor.module enabled and checked out with a zero price product, both with and without roles, with both an anonymous and an authenticated user.
Can someone get a full backtrace for this? It would appear to be a problem with an entity update hook but I can't figure out which entity is causing the problem.
Comment #5
TR CreditAttribution: TR commented#3 was from installing Ubercart on simplytest.me.
I created another site just now to confirm, r0b0c.ply.st if you want to try it - it will be there until just under 24 hours from now.
Here's what I did:
Comment #6
longwaveManaged to obtain a backtrace, will look into this further later:
TypeError: Argument 1 passed to _editor_get_file_uuids_by_field() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in core/modules/editor/editor.module on line 367 in _editor_get_file_uuids_by_field() (line 465 of core/modules/editor/editor.module).
_editor_get_file_uuids_by_field(NULL) (Line: 367)
editor_entity_update(Object)
call_user_func_array('editor_entity_update', Array) (Line: 393)
Drupal\Core\Extension\ModuleHandler->invokeAll('entity_update', Array) (Line: 174)
Drupal\Core\Entity\EntityStorageBase->invokeHook('update', Object) (Line: 423)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('update', Object) (Line: 475)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 309)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 400)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 748)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 363)
Drupal\Core\Entity\Entity->save() (Line: 177)
uc_payment_uc_payment_receipt_insert(Object)
call_user_func_array('uc_payment_uc_payment_receipt_insert', Array) (Line: 393)
Drupal\Core\Extension\ModuleHandler->invokeAll('uc_payment_receipt_insert', Array) (Line: 172)
Drupal\Core\Entity\EntityStorageBase->invokeHook('insert', Object) (Line: 423)
Drupal\Core\Entity\ContentEntityStorageBase->invokeHook('insert', Object) (Line: 475)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, ) (Line: 309)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, ) (Line: 400)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 748)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 363)
Drupal\Core\Entity\Entity->save() (Line: 157)
uc_payment_enter('6', 'free_order', 0, 0, NULL, Object) (Line: 42)
Drupal\uc_payment\Plugin\Ubercart\PaymentMethod\FreeOrder->orderSubmit(Object) (Line: 97)
uc_payment_checkout_review_form_validate(Array, Object)
call_user_func_array('uc_payment_checkout_review_form_validate', Array) (Line: 88)
Drupal\Core\Form\FormValidator->executeValidateHandlers(Array, Object) (Line: 275)
Drupal\Core\Form\FormValidator->doValidateForm(Array, Object, 'uc_cart_checkout_review_form') (Line: 124)
Drupal\Core\Form\FormValidator->validateForm('uc_cart_checkout_review_form', Array, Object) (Line: 574)
Drupal\Core\Form\FormBuilder->processForm('uc_cart_checkout_review_form', Array, Object) (Line: 319)
Drupal\Core\Form\FormBuilder->buildForm('uc_cart_checkout_review_form', Object) (Line: 217)
Drupal\Core\Form\FormBuilder->getForm('Drupal\uc_cart\Form\CheckoutReviewForm', Object) (Line: 219)
Drupal\uc_cart\Controller\CheckoutController->review()
Comment #7
longwaveThe problem here is entirely unrelated to editor.module, but is actually that in some cases we save an order object when it is already in the middle of being saved; this is not supported by the entity API. This then triggers a later crash because the entity object is internally corrupted (the "original" property ends up missing when the first order in the stack completes its save process).
The key to me not reproducing this earlier was that I was testing with a shippable product; this bug only occurs when the order is non-shippable.
Comment #8
TR CreditAttribution: TR commentedThe patch in #7 works for me. It would be nice to add a test case to prevent us from having the same problem in the future.
Comment #9
longwaveComment #10
NetNerdy CreditAttribution: NetNerdy commentedThe patch in #7 works for me too.
Comment #11
rfay#7 works for me as well, and without it I have a fatal on every checkout. Could we get this committed and keep the issue open for tests? I might even be persuaded to write the test.
Comment #12
longwaveModified the existing role test to cover this.
Comment #15
longwaveComment #16
rfayWorks for me! Thanks so much.