The latest commit to the JSONAPI module and its changes to ResourceTypeRepository from issue #2937961: ResourceType should provide related ResourceTypes seems to break sites with jsonapi_extras installed with the following:
PHP Fatal error: Uncaught TypeError: Argument 3 passed to Drupal\jsonapi_extras\ResourceType\ConfigurableResourceTypeRepository::__construct() must implement interface Drupal\Core\Entity\EntityRepositoryInterface, instance of Drupal\Core\Entity\EntityFieldManager given, called in /var/www/drupalvm/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 282 and defined in /var/www/drupalvm/web/modules/contrib/jsonapi_extras/src/ResourceType/ConfigurableResourceTypeRepository.php:50
Attaching a patch that should bring things in line with the upstream changes. Marking this issue critical because it has site-breaking impacts.
| Comment | File | Size | Author |
|---|---|---|---|
| #5 | fix_upstream_ConfigurableResourceTypeRepository-2941481-5.patch | 2.06 KB | logickal |
| #2 | fix_upstream_ConfigurableResourceTypeRepository-2941481-2.patch | 2.31 KB | logickal |
Comments
Comment #2
logickal commentedComment #3
logickal commentedComment #5
logickal commentedRe-rolling the patch to remove extraneous newline causing phpcs violation. I suspect the test failures are related to a version discrepancy between jsonapi and jsonapi_extras on the test-runner, but I will have to dive deeper.
Comment #6
logickal commentedComment #7
e0ipsoThanks for this!
Initial review:
No need to re-declare this here if it's in the parent class.
Let's make
$this->entityFieldManager = $entityFieldManagerinto$this->entityFieldManager = $entity_field_managerIs
$this->bundleManagerdeclared in one of the parent classes?If not, we need to declare it here.
Comment #9
e0ipsoYou'll need to update to the latest jsonapi-dev for this to work.