Skip to content
Snippets Groups Projects
Commit 376c7264 authored by Jess's avatar Jess
Browse files

SA-CORE-2021-010 by bradjones1, xjm, bbrala, gabesullice, Wim Leers, e0ipso

parent 948cb543
No related branches found
No related tags found
Loading
......@@ -393,7 +393,7 @@ public function getRelatableResourceTypes() {
$this->relatableResourceTypesByField = array_reduce(array_map(function (ResourceTypeRelationship $field) {
return [$field->getPublicName() => $field->getRelatableResourceTypes()];
}, array_filter($this->fields, function (ResourceTypeField $field) {
return $field instanceof ResourceTypeRelationship;
return $field instanceof ResourceTypeRelationship && $field->isFieldEnabled();
})), 'array_merge', []);
}
return $this->relatableResourceTypesByField;
......@@ -411,7 +411,7 @@ public function getRelatableResourceTypes() {
* @see self::getRelatableResourceTypes()
*/
public function getRelatableResourceTypesByField($field_name) {
return ($field = $this->getFieldByPublicName($field_name)) && $field instanceof ResourceTypeRelationship
return ($field = $this->getFieldByPublicName($field_name)) && $field instanceof ResourceTypeRelationship && $field->isFieldEnabled()
? $field->getRelatableResourceTypes()
: [];
}
......
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