mglaman / commerce_cart_api

Original sandbox WIP for the module now on Drupal.org. Do not fork. Patches accepted on Drupal.org
https://www.drupal.org/project/commerce_cart_api
9 stars 1 forks source link

Items tracked for 2.x and Drupal 8. 7JSON API #17

Closed mglaman closed 4 years ago

mglaman commented 5 years ago

Base field + bundles problem

By mocking the bundle for the unknown order, we cannot have any field config values.

    $field_definitions = $this->fieldManager->getFieldDefinitions(
      $entity_type_id,
      $resource_type->getBundle()
    );
    if (empty($context['related']) || empty($field_definitions[$context['related']])) {
      throw new BadRequestHttpException('Invalid or missing related field.');
    }

This causes the related field to not exist.

mglaman commented 4 years ago

Outdated. We now have JSON:API Resources.