Fixed theme function issue after creating entity, and remove "(Client)" etc from name finally!

This commit is contained in:
naomi 2021-08-26 18:58:25 +01:00
parent 436607a305
commit 3586ef5788
2 changed files with 10 additions and 19 deletions

View File

@ -40,6 +40,16 @@ function opencase_cases_theme() {
'render element' => 'content',
'variables' => ['content' => NULL],
'file' => 'oc_case.page.inc',
],
'oc_actor_case_relation' => [
'render element' => 'elements',
'file' => 'oc_actor_case_relation.page.inc',
'template' => 'oc_actor_case_relation',
],
'oc_actor_case_relation_content_add_list' => [
'render element' => 'content',
'variables' => ['content' => NULL],
'file' => 'oc_actor_case_relation.page.inc',
]
];
}
@ -138,24 +148,6 @@ function opencase_query_oc_activity_access_alter($query) {
$query->condition('access_filter.actors_involved_target_id', $linked_actor_id);
}
/**
* Implements hook_theme().
*/
function opencase_cases_theme() {
$theme = [];
$theme['oc_actor_case_relation'] = [
'render element' => 'elements',
'file' => 'oc_actor_case_relation.page.inc',
'template' => 'oc_actor_case_relation',
];
$theme['oc_actor_case_relation_content_add_list'] = [
'render element' => 'content',
'variables' => ['content' => NULL],
'file' => 'oc_actor_case_relation.page.inc',
];
return $theme;
}
/**
* Implements hook_theme_suggestions_HOOK().
*/

View File

@ -122,7 +122,6 @@ class OCActor extends RevisionableContentEntityBase implements OCActorInterface
if ($this->get('middle_names')->value) $name .= $this->get('middle_names')->value . ' ';
$name .= $this->get('last_name')->value . ' ';
}
$name .= '(' . $this->type->entity->label() . ')';
$this->setName($name);