When I add a field with "Commerce adjustment" field type, click save, then I was redirected to the field setting page, below are the errors:
Notice: Undefined index: default_formatter in Drupal\Core\Field\FormatterPluginManager->prepareConfiguration() (line 150 of core/lib/Drupal/Core/Field/FormatterPluginManager.php).
Drupal\Core\Field\FormatterPluginManager->prepareConfiguration(Array, Array) (Line: 331)
Drupal\Core\Entity\EntityDisplayBase->setComponent('field_delivery_fee', Array) (Line: 456)
Drupal\field_ui\Form\FieldStorageAddForm->configureEntityViewDisplay('field_delivery_fee', NULL) (Line: 363)
Drupal\field_ui\Form\FieldStorageAddForm->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: 585)
Drupal\Core\Form\FormBuilder->processForm('field_ui_field_storage_add_form', Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder->buildForm('field_ui_field_storage_add_form', Object) (Line: 74)
Drupal\Core\Controller\FormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 144)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 64)
Symfony\Component\HttpKernel\HttpKernel->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: 99)
Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel->handle(Object, 1, 1) (Line: 652)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
I am not sure if this is related, the order adjustments out of box are not visible via REST.
Comments
Comment #2
bojanz commentedThere is no REST integration for adjustments, so that part is expected.
Do note that you're not supposed to create an adjustments field for a delivery fee, you're supposed to use the existing one.
Comment #3
mglamanhttps://github.com/drupalcommerce/commerce/blob/8.x-2.x/modules/order/sr...
Because we do not provide a formatter. I guess it needs to be set to "hidden" or something to avoid this error? Never added this field type via the UI. It should probably has "no_ui = TRUE" like the PasswordItem field. With "no_ui" set we can mitigate this whole problem, forcing it to be added via base field definitions, etc.
See PasswordItem http://cgit.drupalcode.org/drupal/tree/core/lib/Drupal/Core/Field/Plugin...
Comment #4
bojanz commentedYes, let's add no_ui.
Comment #5
bojanz commentedComment #7
bojanz commented