Skip to content

Commit

Permalink
add support for path aliases (#517)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackrabbithanna authored Jan 29, 2025
1 parent c454fcc commit 811968b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Entity/CivicrmEntity.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,14 @@ public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
->setDisplayConfigurable('form', FALSE)
->setClass(ActivityEndDateFieldItemList::class);
}

$module_handler = \Drupal::getContainer()->get('module_handler');
if ($module_handler->moduleExists('path')) {
$fields['path'] = BaseFieldDefinition::create('path')
->setLabel(t('URL alias'))
->setDisplayOptions('form', ['type' => 'path', 'weight' => 30])
->setDisplayConfigurable('form', TRUE)
->setComputed(TRUE);
}
return $fields;
}

Expand Down

0 comments on commit 811968b

Please sign in to comment.