Opencase_cases.module is still in broken state

This commit is contained in:
naomi 2021-04-05 15:47:49 +01:00
parent 715f5f34c4
commit 06b2409c61

View File

@ -35,14 +35,13 @@ function opencase_cases_theme() {
'render element' => 'elements',
'file' => 'oc_case.page.inc',
'template' => 'oc_case',
]
],
'oc_case_content_add_list' => [
'render element' => 'content',
'variables' => ['content' => NULL],
'file' => 'oc_case.page.inc',
]
];
];
}
function opencase_cases_entity_base_field_info($entity_type) {
@ -68,13 +67,13 @@ function opencase_cases_entity_base_field_info($entity_type) {
}
/**
* When creating an activity, it sets the case id from the URL.
*/
/* When creating an activity, it sets the case id from the URL.
/*/
public static function opencase_cases_default_activity_case_value() {
return array(\Drupal::request()->query->get('case_id'));
}
/**
/**
* Implementation of hook_form_alter()
* Changes what page is redirected to after deleting things
*/
@ -91,14 +90,14 @@ function opencase_cases_form_alter(&$form, &$form_state, $form_id) {
function _opencase_cases_redirect_to_home($form, &$form_state) {
$form_state->setRedirect('<front>');
}
function _opencase_cases_delete_activity_redirect($form, &$form_state) {
$case_id = $form_state->getFormObject()->getEntity()->oc_case->target_id;
$form_state->setRedirect('entity.oc_case.canonical', ['oc_case' => $case_id]);
}
/**
* Implements hook_theme_suggestions_HOOK().
*/
* Implements hook_theme_suggestions_HOOK().
*/
function opencase_cases_theme_suggestions_oc_case(array $variables) {
$suggestions = [];
$entity = $variables['elements']['#oc_case'];