Changing routes back after they got changed when regenerating entities
This commit is contained in:
parent
a48e37ad39
commit
cf0d928423
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
@ -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",
|
||||
|
Reference in New Issue
Block a user