moved entity type relations widget into opencase_defaults

This commit is contained in:
Naomi 2020-11-20 12:04:22 +00:00
parent ca1a0eda29
commit 113ff6361b
4 changed files with 19 additions and 19 deletions

View File

@ -8,6 +8,7 @@
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\user\Entity\Role;
use Drupal\user\RoleInterface;
use Drupal\opencase\EntityTypeRelationsWidget;
/**
* Implements hook_help().
@ -146,3 +147,21 @@ function opencase_defaults_actors_involved_callback() {
return array_unique([$currently_viewed_actor_id, $author_linked_actor_id]);
}
/**
* Implements hook_form_ID_alter
*/
function opencase_defaults_form_oc_case_type_add_form_alter(&$form, $form_state) {
$widget = new EntityTypeRelationsWidget();
$widget->setup($form);
}
/**
* Implements hook_form_ID_alter
*/
function opencase_defaults_form_oc_case_type_edit_form_alter(&$form, $form_state) {
$widget = new EntityTypeRelationsWidget();
$widget->setup($form);
$widget->populate($form);
}

View File

@ -7,7 +7,6 @@
use Drupal\Core\Routing\RouteMatchInterface;
use Drupal\Core\Access\AccessResult;
use Drupal\opencase\EntityTypeRelationsWidget;
/**
* Implements hook_element_info_alter().
@ -81,24 +80,6 @@ function opencase_theme() {
];
}
/**
* Implements hook_form_ID_alter
*/
function opencase_form_oc_case_type_add_form_alter(&$form, $form_state) {
$widget = new EntityTypeRelationsWidget();
$widget->setup($form);
}
/**
* Implements hook_form_ID_alter
*/
function opencase_form_oc_case_type_edit_form_alter(&$form, $form_state) {
$widget = new EntityTypeRelationsWidget();
$widget->setup($form);
$widget->populate($form);
}
/**
* Implements hook_uninstall().
* Removes configs.