diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php index 8a7650ff36fc280a00c1fe255e7cc804b60a3df4..1580fa618a6ea3cba1203ec6789029e61a8c726f 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Form/FieldInstanceEditForm.php @@ -9,6 +9,7 @@ use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Form\FormBase; +use Drupal\Component\Utility\String; use Drupal\field\FieldInstanceInterface; use Drupal\field_ui\FieldUI; use Symfony\Component\DependencyInjection\ContainerInterface; @@ -220,4 +221,17 @@ public function delete(array &$form, array &$form_state) { ); } + /** + * The _title_callback for the field instance settings form. + * + * @param \Drupal\field\FieldInstanceInterface $field_instance + * The field instance. + * + * @return string + * The label of the field instance. + */ + public function getTitle(FieldInstanceInterface $field_instance) { + return String::checkPlain($field_instance->label()); + } + } diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Routing/RouteSubscriber.php b/core/modules/field_ui/lib/Drupal/field_ui/Routing/RouteSubscriber.php index 048630a2b5c98962131dbf41f77feb3f05cc2d8f..b703ed474dbde3266c2bf908be48e5674c5305b6 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Routing/RouteSubscriber.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Routing/RouteSubscriber.php @@ -70,7 +70,10 @@ protected function routes(RouteCollection $collection) { $route = new Route( "$path/fields/{field_instance}", - array('_form' => '\Drupal\field_ui\Form\FieldInstanceEditForm'), + array( + '_form' => '\Drupal\field_ui\Form\FieldInstanceEditForm', + '_title_callback' => '\Drupal\field_ui\Form\FieldInstanceEditForm::getTitle', + ), array('_permission' => 'administer ' . $entity_type . ' fields') ); $collection->add("field_ui.instance_edit_$entity_type", $route); diff --git a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php index 705c2b680b4138650574f1c8410963cccf2fce82..f103e6d31bceb79922498736f109248700e046db 100644 --- a/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php @@ -73,6 +73,8 @@ function fieldUIAddNewField($bundle_path, $initial_edit, $field_edit = array(), // First step : 'Add new field' on the 'Manage fields' page. $this->drupalPostForm("$bundle_path/fields", $initial_edit, t('Save')); $this->assertRaw(t('These settings apply to the %label field everywhere it is used.', array('%label' => $label)), 'Field settings page was displayed.'); + // Test Breadcrumbs. + $this->assertLink($label, 0, 'Field label is correct in the breadcrumb of the field settings page.'); // Second step : 'Field settings' form. $this->drupalPostForm(NULL, $field_edit, t('Save field settings')); @@ -129,6 +131,9 @@ function fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label) { $this->drupalGet("$bundle_path/fields/$field_name/delete"); $this->assertRaw(t('Are you sure you want to delete the field %label', array('%label' => $label)), 'Delete confirmation was found.'); + // Test Breadcrumbs. + $this->assertLink($label, 0, 'Field label is correct in the breadcrumb of the field delete page.'); + // Submit confirmation form. $this->drupalPostForm(NULL, array(), t('Delete')); $this->assertRaw(t('The field %label has been deleted from the %type content type.', array('%label' => $label, '%type' => $bundle_label)), 'Delete message was found.');