Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Currently checkout fails when the Editor module is enabled.
TypeError: Argument 1 passed to _editor_get_file_uuids_by_field() must implement interface Drupal\Core\Entity\EntityInterface, null given, called in /var/platform/web/core/modules/editor/editor.module
This is because we invoke \Drupal\commerce_cart\CartProvider::finalizeCart
which defaults to saving the cart. However, this save is running within another save. It is causing the ->original
property to get popped off, making update hooks and events fail.
We need to check if the original flag is set when invoking the service in commerce_cart_commerce_order_presave
Comment | File | Size | Author |
---|---|---|---|
#7 | checkout_fails_when-2807567-7.patch | 3.81 KB | mglaman |
#4 | checkout_fails_when-2807567-4.patch | 1.35 KB | mglaman |
Comments
Comment #2
mglamanWe should also follow up to try and get a
isSaving
method on content entities. Config hasisSyncing
, so why not check much more easily if content is saving.Comment #3
mglamanHere is the fix.
Comment #4
mglamanPR: https://github.com/drupalcommerce/commerce/pull/513
Comment #5
mglamanComment #6
mglamanNeed to update patch because Travis still failed. But at least error was reproduced in Travis: https://travis-ci.org/drupalcommerce/commerce/jobs/163272451
Comment #7
mglamanNew patch
Comment #9
bojanz CreditAttribution: bojanz at Centarro commentedMerged.