From cf0d928423ba27c2ec7e0f6af6ec6bf5e6dbcf60 Mon Sep 17 00:00:00 2001 From: naomi Date: Wed, 11 Apr 2018 12:39:39 +0200 Subject: [PATCH] Changing routes back after they got changed when regenerating entities --- modules/zencrm_entities/src/Entity/Person.php | 8 ++++---- modules/zencrm_entities/zencrm_entities.links.task.yml | 10 ---------- modules/zencrm_entities/zencrm_entities.module | 3 --- src/Plugin/Block/HatCreator.php | 2 ++ 4 files changed, 6 insertions(+), 17 deletions(-) diff --git a/modules/zencrm_entities/src/Entity/Person.php b/modules/zencrm_entities/src/Entity/Person.php index 2d9eb97..c7950fa 100644 --- a/modules/zencrm_entities/src/Entity/Person.php +++ b/modules/zencrm_entities/src/Entity/Person.php @@ -44,10 +44,10 @@ use Drupal\user\UserInterface; * "status" = "status", * }, * links = { - * "canonical" = "/admin/structure/person/{person}", - * "add-form" = "/admin/structure/person/add", - * "edit-form" = "/admin/structure/person/{person}/edit", - * "delete-form" = "/admin/structure/person/{person}/delete", + * "canonical" = "/zencrm/person/{person}", + * "add-form" = "/zencrm/person/add", + * "edit-form" = "/zencrm/person/{person}/edit", + * "delete-form" = "/zencrm/person/{person}/delete", * "collection" = "/admin/structure/person", * }, * field_ui_base_route = "person.settings" diff --git a/modules/zencrm_entities/zencrm_entities.links.task.yml b/modules/zencrm_entities/zencrm_entities.links.task.yml index 012bc0e..0545d15 100644 --- a/modules/zencrm_entities/zencrm_entities.links.task.yml +++ b/modules/zencrm_entities/zencrm_entities.links.task.yml @@ -14,11 +14,6 @@ entity.person.edit_form: base_route: entity.person.canonical title: 'Edit' -entity.person.version_history: - route_name: entity.person.version_history - base_route: entity.person.canonical - title: 'Revisions' - entity.person.delete_form: route_name: entity.person.delete_form base_route: entity.person.canonical @@ -41,11 +36,6 @@ entity.contact_details.edit_form: base_route: entity.contact_details.canonical title: 'Edit' -entity.contact_details.version_history: - route_name: entity.contact_details.version_history - base_route: entity.contact_details.canonical - title: 'Revisions' - entity.contact_details.delete_form: route_name: entity.contact_details.delete_form base_route: entity.contact_details.canonical diff --git a/modules/zencrm_entities/zencrm_entities.module b/modules/zencrm_entities/zencrm_entities.module index 7a77cf4..7228358 100644 --- a/modules/zencrm_entities/zencrm_entities.module +++ b/modules/zencrm_entities/zencrm_entities.module @@ -10,7 +10,6 @@ use Drupal\Core\Routing\RouteMatchInterface; /** * Implements hook_ENTITY_TYPE_presave(). * Computes the full_name field from first_name middle_names and last_name. - * Computes the first_and_last_name field from first_name and last_name. */ function zencrm_entities_person_presave($entity) { $first_name = $entity->first_name->getString(); @@ -19,10 +18,8 @@ function zencrm_entities_person_presave($entity) { if ($middle_names) { $middle_names .= ' '; } - $first_and_last_name = $first_name . ' ' . $last_name; $full_name = $first_name . ' ' . $middle_names . $last_name; $entity->set('full_name', $full_name); - $entity->set('first_and_last_name', $first_and_last_name); } diff --git a/src/Plugin/Block/HatCreator.php b/src/Plugin/Block/HatCreator.php index 79747d9..f189a5a 100644 --- a/src/Plugin/Block/HatCreator.php +++ b/src/Plugin/Block/HatCreator.php @@ -6,6 +6,8 @@ use Drupal\Core\Block\BlockBase; /** * Provides a 'HatCreator' block. + * Block contains links for creating hats of types that the person does not already have. + * The links open an entity create form in a popup. * * @Block( * id = "hat_creator",