File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -151,11 +151,15 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
151
151
}
152
152
$ module_handler = \Drupal::getContainer ()->get ('module_handler ' );
153
153
if ($ module_handler ->moduleExists ('path ' )) {
154
- $ fields ['path ' ] = BaseFieldDefinition::create ('path ' )
155
- ->setLabel (t ('URL alias ' ))
156
- ->setDisplayOptions ('form ' , ['type ' => 'path ' , 'weight ' => 30 ])
157
- ->setDisplayConfigurable ('form ' , TRUE )
158
- ->setComputed (TRUE );
154
+ $ config = \Drupal::config ('civicrm_entity.settings ' );
155
+ $ enabled_entity_types = $ config ->get ('enabled_entity_types ' ) ?: [];
156
+ if (in_array ($ entity_type ->id (), $ enabled_entity_types )) {
157
+ $ fields ['path ' ] = BaseFieldDefinition::create ('path ' )
158
+ ->setLabel (t ('URL alias ' ))
159
+ ->setDisplayOptions ('form ' , ['type ' => 'path ' , 'weight ' => 30 ])
160
+ ->setDisplayConfigurable ('form ' , TRUE )
161
+ ->setComputed (TRUE );
162
+ }
159
163
}
160
164
return $ fields ;
161
165
}
You can’t perform that action at this time.
0 commit comments