summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2013-10-31 11:43:43 (GMT)
committerNathaniel Catchpole2013-10-31 11:43:43 (GMT)
commit992570105947894a9ef18cf5b91aff17d075dc19 (patch)
tree67933bdbe73008cfd2038faf43d0c4fec6473683
parent8b6fdb56ea08a9c4adf2b608ea2a9241e3f19493 (diff)
Issue #2102447 by disasm, vijaycs85, ACF: Remove drupal_set_title() in entity module controllers.
-rw-r--r--core/modules/entity/entity.routing.yml2
-rw-r--r--core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php2
-rw-r--r--core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php6
-rw-r--r--core/modules/entity/lib/Drupal/entity/Form/EntityFormModeAddForm.php1
4 files changed, 6 insertions, 5 deletions
diff --git a/core/modules/entity/entity.routing.yml b/core/modules/entity/entity.routing.yml
index 8b07bdd..f390a650 100644
--- a/core/modules/entity/entity.routing.yml
+++ b/core/modules/entity/entity.routing.yml
@@ -16,6 +16,7 @@ entity.view_mode_add:
path: '/admin/structure/display-modes/view/add'
defaults:
_content: '\Drupal\entity\Controller\EntityDisplayModeController::viewModeTypeSelection'
+ _title: 'Choose view mode entity type'
requirements:
_permission: 'administer display modes'
@@ -51,6 +52,7 @@ entity.form_mode_add:
path: '/admin/structure/display-modes/form/add'
defaults:
_content: '\Drupal\entity\Controller\EntityDisplayModeController::formModeTypeSelection'
+ _title: 'Choose form mode entity type'
requirements:
_permission: 'administer display modes'
diff --git a/core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php b/core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php
index da7b936..eb0e641 100644
--- a/core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php
+++ b/core/modules/entity/lib/Drupal/entity/Controller/EntityDisplayModeController.php
@@ -49,7 +49,6 @@ class EntityDisplayModeController implements ContainerInjectionInterface {
* A list of entity types to add a view mode for.
*/
public function viewModeTypeSelection() {
- drupal_set_title(t('Choose view mode entity type'));
$entity_types = array();
foreach ($this->entityManager->getDefinitions() as $entity_type => $entity_info) {
if ($entity_info['fieldable'] && isset($entity_info['controllers']['view_builder'])) {
@@ -73,7 +72,6 @@ class EntityDisplayModeController implements ContainerInjectionInterface {
* A list of entity types to add a form mode for.
*/
public function formModeTypeSelection() {
- drupal_set_title(t('Choose form mode entity type'));
$entity_types = array();
foreach ($this->entityManager->getDefinitions() as $entity_type => $entity_info) {
if ($entity_info['fieldable'] && isset($entity_info['controllers']['form'])) {
diff --git a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php
index a3167c5..2088273 100644
--- a/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php
+++ b/core/modules/entity/lib/Drupal/entity/Form/EntityDisplayModeAddForm.php
@@ -24,7 +24,10 @@ class EntityDisplayModeAddForm extends EntityDisplayModeFormBase {
*/
public function buildForm(array $form, array &$form_state, $entity_type = NULL) {
$this->entityType = $entity_type;
- return parent::buildForm($form, $form_state);
+ $form = parent::buildForm($form, $form_state);
+ $definition = $this->entityManager->getDefinition($this->entityType);
+ $form['#title'] = $this->t('Add new %label @entity-type', array('%label' => $definition['label'], '@entity-type' => strtolower($this->entityInfo['label'])));
+ return $form;
}
/**
@@ -45,7 +48,6 @@ class EntityDisplayModeAddForm extends EntityDisplayModeFormBase {
throw new NotFoundHttpException();
}
- drupal_set_title(t('Add new %label @entity-type', array('%label' => $definition['label'], '@entity-type' => strtolower($this->entityInfo['label']))), PASS_THROUGH);
$this->entity->targetEntityType = $this->entityType;
}
diff --git a/core/modules/entity/lib/Drupal/entity/Form/EntityFormModeAddForm.php b/core/modules/entity/lib/Drupal/entity/Form/EntityFormModeAddForm.php
index 307baa6..84432e4 100644
--- a/core/modules/entity/lib/Drupal/entity/Form/EntityFormModeAddForm.php
+++ b/core/modules/entity/lib/Drupal/entity/Form/EntityFormModeAddForm.php
@@ -23,7 +23,6 @@ class EntityFormModeAddForm extends EntityDisplayModeAddForm {
throw new NotFoundHttpException();
}
- drupal_set_title(t('Add new %label @entity-type', array('%label' => $definition['label'], '@entity-type' => strtolower($this->entityInfo['label']))), PASS_THROUGH);
$this->entity->targetEntityType = $this->entityType;
}