An unexpected value could not be normalized

Created on 18 May 2023, over 1 year ago

An unexpected value could not be normalized

When I tried to checkout the product i.e. on click of Pay and complete Purchase button I am getting error as per -

Drupal\Core\Entity\EntityStorageException: Could not normalize object of type "Drupal\commerce_price\Price", no supporting normalizer found. in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 815 of /var/www/web/spbatpa.org/web/core/lib/Drupal/Core/Entity/Sql/SqlContentEntityStorage.php).

I tried with the different payment processor like -
- PayPal Test
- Paypal Checkout
- Manual
My customer getting the issue for
- PayPal Live

so It's not a definitely the payment processor issue.

I am using
- Commerce: 8.x-2.35
- PHP 8.0.28
- Drupal core 9.5.8

Please help

🐛 Bug report
Status

Active

Version

2.35

Component

Commerce

Created by

🇮🇳India sachindoijad

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @sachindoijad
  • 🇮🇱Israel jsacksick

    Never experienced this... Did you double check your custom code? Can you reproduce this on a clean install?

  • Status changed to Postponed: needs info over 1 year ago
  • Hi, I am seeing also this error when I upgraded commerce to 2.36 from 2.33. As I checked I think this causing the issue, the addition of https://git.drupalcode.org/project/commerce/-/blob/8.x-2.36/modules/log/...

  • I am also seeing this error with REST export views for Commerce Log entities, if the view results contain any Log entity which has a template that expects Price parameters. Since a typical checkout flow implies an automatically-created payment after completion, the order's activity log will have an entry for the payment with its amount, and so you can't expose the activity log of non-draft orders.

  • 🇺🇸United States brainiacque

    I had the same thing happen to me recently. Thanks to the comment by @ts.ag, I remembered seeing something about logging on the Order settings page. When I changed the setting to "Prevent the save and throw an exception that may cause a fatal error," the problem disappeared.

  • 🇺🇸United States brainiacque

    I still cannot resolve this issue after attempting multiple configuration changes.

    I am using the following Commerce modules alongside Drupal 10.4.0:

    • Commerce Core 8.x-2.40 (I do not have Commerce Payment Example module installed)
    • Commerce File 8.x-2.2
    • Commerce License 3.0.1
    • Commerce PayPal 8.x-1.8
    • Commerce Shipping 8.x-2.11
    • Commerce Stock 8.x-1.3

    I have enabled PayPal Checkout (Preferred) as the only payment gateway with the correct Client ID, Secret, and Webhook ID, and I have selected Capture as the Transaction type.

    I am using the Default order type with the Default checkout flow:
    Log in
    Log in or continue as guest (Guest checkout: Allowed; Registration: Not allowed)
    Order information
    Contact information (Require double entry of email: Yes)
    Payment information
    Review
    Review
    Payment
    Payment process (Transaction mode: Authorize and capture)
    PayPal Checkout payment process (Transaction mode: Authorize and capture)
    Complete
    Completion message (Default)
    Files download
    Sidebar
    Order summary (View: Checkout order summary)
    Coupon redemption (Allows multiple coupons: No)

    Any help would be appreciated.

Production build 0.71.5 2024