Updated: Comment #0

Problem/Motivation

Before:
Before
After:
after

Proposed resolution

I think we should fix it in breadcrumb builder as can be seen in the attached patch #0
@dawehner suggested we should fix it in \Drupal\field_ui\Routing\RouteSubscriber::routes see #1 and http://privatepaste.com/2b58ea47c8.

Remaining tasks

Decide is it ok to fix it in breadcrumb builder? Or do we have to fix fields routing title.

User interface changes

See after image

API changes

None

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jibran’s picture

Issue summary: View changes
FileSize
1.83 KB
3.42 KB

Here is the other approach approved by @dawehner.

New After

After

amateescu’s picture

Is there a reason for using the FieldUi class instead of the class that displays the form (FieldInstanceEditForm)?

jibran’s picture

It is just a static code we can move it around if the approach is fine we can move it to anyplace.

jibran’s picture

Issue summary: View changes

The last submitted patch, fields-breadcrumb-fix.patch, failed testing.

amateescu’s picture

The approach seems fine :) Let's move it to a getTitle() method on FieldInstanceEditForm and also remove $form['#title'] from that form.

jibran’s picture

Moved \Drupal\field_ui\Form\FieldInstanceEditForm::getTitle. I don't think we should remove $form['#title']

Before Removing

before

After Removing

After
Title is all messed up so I think we should keep it.

amateescu’s picture

Sure, let's keep it then.

+++ b/core/modules/field_ui/lib/Drupal/field_ui/Routing/RouteSubscriber.php
@@ -70,7 +70,9 @@ protected function routes(RouteCollection $collection) {
+          array('_form' => '\Drupal\field_ui\Form\FieldInstanceEditForm',

'_form' needs to be moved below "array(", on it's own row :)

jibran’s picture

FileSize
1.97 KB
832 bytes
amateescu’s picture

Title: Fields settings page breadcrumb is not correct. » Fields settings page breadcrumb is not correct
Component: base system » field_ui.module
Status: Needs review » Reviewed & tested by the community

Thanks!

The last submitted patch, 9: 2147685-9.patch, failed testing.

jibran’s picture

Issue tags: +Quick fix

It is a quick fix IMHO.

webchick’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Can we get a quick test for this?

jibran’s picture

Status: Needs work » Needs review
Issue tags: -Needs tests
FileSize
1.61 KB
1.61 KB
3.58 KB

Here are some tests.

The last submitted patch, 14: 2147685-test-only.patch, failed testing.

Status: Needs review » Needs work

The last submitted patch, 14: 2147685-14.patch, failed testing.

The last submitted patch, 14: 2147685-14.patch, failed testing.

jibran’s picture

Status: Needs work » Needs review

14: 2147685-14.patch queued for re-testing.

amateescu’s picture

  1. +++ 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(),
    +    $this->assertLink($label, 0, 'Breadcrumbs were correct on field settings page.');
    

    We normally use present tense in test assertions, so how about 'Field label is correct in the breadcrumb of the field settings page.'

  2. +++ b/core/modules/field_ui/lib/Drupal/field_ui/Tests/FieldUiTestBase.php
    @@ -129,6 +131,9 @@ function fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label) {
    +    $this->assertLink($label, 0, 'Breadcrumbs were correct on field delete page.');
    

    And 'Field label is correct in the breadcrumb of the field delete page.'

jibran’s picture

FileSize
3.62 KB
1.52 KB

Fixed. But

+++ 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(),
     $this->assertRaw(t('These settings apply to the %label field everywhere it is used.', array('%label' => $label)), 'Field settings page was displayed.');

@@ -129,6 +131,9 @@ function fieldUIDeleteField($bundle_path, $field_name, $label, $bundle_label) {
     $this->assertRaw(t('Are you sure you want to delete the field %label', array('%label' => $label)), 'Delete confirmation was found.');

In my defiance.

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

I think those examples are fine as they are, but "was correct" sounds to me more like "it was correct at some point but it's not necessarily the case anymore". It's also probably just a matter of preference, so thanks for the quick update :)

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.