summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgabesullice2018-02-22 23:22:27 (GMT)
committerMateu Aguiló Bosch2018-02-22 23:22:27 (GMT)
commit26e1962d91c4730e8a68b78ac15e0184a004ae8b (patch)
tree1682a9c9fe91f4593a02064a8d36b4ffeb329e31
parentc2d0f5368a8a19b5aa4f525977ca62d62d7362d6 (diff)
Issue #2946790 by gabesullice, mkolar, swentel, vtcore, e0ipso, PrineShazar: ConfigurableResourceTypeRepository does not call setRelatableResourceTypes()8.x-1.0-rc2
-rw-r--r--src/ResourceType/ConfigurableResourceType.php7
-rw-r--r--src/ResourceType/ConfigurableResourceTypeRepository.php4
2 files changed, 10 insertions, 1 deletions
diff --git a/src/ResourceType/ConfigurableResourceType.php b/src/ResourceType/ConfigurableResourceType.php
index 0917547..9b43d56 100644
--- a/src/ResourceType/ConfigurableResourceType.php
+++ b/src/ResourceType/ConfigurableResourceType.php
@@ -51,7 +51,12 @@ class ConfigurableResourceType extends ResourceType {
* The configuration factory.
*/
public function __construct($entity_type_id, $bundle, $deserialization_target_class, JsonapiResourceConfig $resource_config, ResourceFieldEnhancerManager $enhancer_manager, ConfigFactoryInterface $config_factory) {
- parent::__construct($entity_type_id, $bundle, $deserialization_target_class);
+ parent::__construct(
+ $entity_type_id,
+ $bundle,
+ $deserialization_target_class,
+ (bool) $resource_config->get('disabled')
+ );
$this->jsonapiResourceConfig = $resource_config;
$this->enhancerManager = $enhancer_manager;
diff --git a/src/ResourceType/ConfigurableResourceTypeRepository.php b/src/ResourceType/ConfigurableResourceTypeRepository.php
index 61a4388..f07c4ea 100644
--- a/src/ResourceType/ConfigurableResourceTypeRepository.php
+++ b/src/ResourceType/ConfigurableResourceTypeRepository.php
@@ -124,6 +124,10 @@ class ConfigurableResourceTypeRepository extends ResourceTypeRepository {
$this->configFactory
);
}
+ foreach ($this->resourceTypes as $resource_type) {
+ $relatable_resource_types = $this->calculateRelatableResourceTypes($resource_type);
+ $resource_type->setRelatableResourceTypes($relatable_resource_types);
+ }
}
if (!isset($this->enabledResourceTypes) && !$include_disabled) {