Skip to content
Snippets Groups Projects
Unverified Commit c816076b authored by Mateu Aguiló Bosch's avatar Mateu Aguiló Bosch Committed by Mateu Aguiló Bosch
Browse files

Issue #2982133 by Wim Leers, e0ipso: No longer works with JSON API >=1.21 (so either 1.21 or 1.22)

parent f67e2adc
No related branches found
Tags 8.x-1.21
No related merge requests found
......@@ -4,6 +4,7 @@ namespace Drupal\jsonapi_extras\Entity;
use Drupal\Core\Config\Entity\ConfigEntityBase;
use Drupal\Core\Entity\EntityStorageInterface;
use Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException;
/**
* Defines the JSON API Resource Config entity.
......@@ -113,8 +114,11 @@ class JsonapiResourceConfig extends ConfigEntityBase {
* Triggers rebuilding of JSON API routes.
*/
protected static function rebuildRoutes() {
\Drupal::service('jsonapi.resource_type.repository')->reset();
\Drupal::service('router.builder')->setRebuildNeeded();
try {
\Drupal::service('jsonapi.resource_type.repository')->reset();
\Drupal::service('router.builder')->setRebuildNeeded();
}
catch (ServiceNotFoundException $exception) {}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment