From 9a50a71f4f9171b67e0504cc0afa02d41bfc9a47 Mon Sep 17 00:00:00 2001
From: M Parker <mparker17@536298.no-reply.drupal.org>
Date: Tue, 31 Jul 2018 19:46:04 -0400
Subject: [PATCH] 2989280-3

---
 src/Entity/Controller/GroupController.php | 15 +++++++++++++++
 src/Entity/Routing/GroupRouteProvider.php |  1 +
 2 files changed, 16 insertions(+)

diff --git a/src/Entity/Controller/GroupController.php b/src/Entity/Controller/GroupController.php
index 6f49148..2b37cdf 100644
--- a/src/Entity/Controller/GroupController.php
+++ b/src/Entity/Controller/GroupController.php
@@ -124,4 +124,19 @@ class GroupController extends ControllerBase {
     return $this->entityFormBuilder()->getForm($entity, 'add', $extra);
   }
 
+  /**
+   * The _title_callback for the group.add route.
+   *
+   * @param \Drupal\group\Entity\GroupTypeInterface $group_type
+   *   The type of group to create.
+   *
+   * @return string
+   *   The page title.
+   */
+  public function addFormTitle(GroupTypeInterface $group_type) {
+    return $this->t('Add @group_type_label', [
+      '@group_type_label' => $group_type->label(),
+    ]);
+  }
+
 }
diff --git a/src/Entity/Routing/GroupRouteProvider.php b/src/Entity/Routing/GroupRouteProvider.php
index 1bc824a..398cf84 100644
--- a/src/Entity/Routing/GroupRouteProvider.php
+++ b/src/Entity/Routing/GroupRouteProvider.php
@@ -27,6 +27,7 @@ class GroupRouteProvider extends DefaultHtmlRouteProvider {
     if ($route = parent::getAddFormRoute($entity_type)) {
       $route->setOption('_group_operation_route', TRUE);
       $route->setDefault('_controller', '\Drupal\group\Entity\Controller\GroupController::addForm');
+      $route->setDefault('_title_callback', '\Drupal\group\Entity\Controller\GroupController::addFormTitle');
       return $route;
     }
   }
-- 
2.18.0

