Error when trying to enable adjustments

Created on 8 February 2023, about 2 years ago
Updated 9 May 2024, 11 months ago

Bug

Fatal error when making configurations on Drupal UI, without any custom code.

1. Install Drupal 10.1 with standard profile and Commerce 2.33.
2. Enable all commerce modules.
3. Head to /admin/commerce/config/order-item-types/default/edit/display
4. Face a fatal error Uncaught PHP Exception Drupal\Component\Plugin\Exception\PluginNotFoundException: "The "hidden" plugin does not exist. Valid plugin IDs for Drupal\Core\Field\FormatterPluginManager are ...

🐛 Bug report
Status

Needs review

Version

2.0

Component

Order

Created by

🇫🇮Finland sokru

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

Comments & Activities

  • Issue created by @sokru
  • 🇺🇦Ukraine v.koval

    I just repeated the steps and everything is working fine. Can you provide more details please?

  • 🇺🇦Ukraine v.koval

    It seems that the adjustment field doesn't have a formatter. I think we need to attach some default formatter for the adjustment field. Let's say some formatter that have price field because adjustment it's also a price.

  • 🇺🇦Ukraine v.koval

    You can try this patch, it should fix your problem. We just attach the default formatter for our adjustment field.

  • 🇭🇺Hungary ibis

    This is still active for me also. Composer.json attached what i used for test this.
    Bug is appear when u move the Adjustments field from hidden to the visible region and hit the save button.

  • Status changed to Needs review 11 months ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 9.5.x + Environment: PHP 8.0 & MySQL 5.7
    last update 11 months ago
    786 pass, 2 fail
  • 🇮🇱Israel jsacksick

    I don't really consider this a major bug as nothing happens if you simply don't drag the adjustments field to display it...
    I don't think it makes sense to use the PriceDefaultFormatter either.

    So that leaves us with 2 options:

    1. We define a new formatter, but not sure what the formatter would do? Output a table? Just an HTML list of adjustment labels => values
    2. Remove the following: ->setDisplayConfigurable('view', TRUE);

    I think the second option is better for now, unless you really need to display the order item adjustments somewhere? I don't really see what would be the use case for that?

    The attached patch is addressing the option #2.

Production build 0.71.5 2024