Problem/Motivation
In large sites with thousands of terms across different vocabularies it is not possible to know which vocabulary the terms belong to when editing it.
I have a situation where the term 'apple' appears in two different vocabularies ending up with one URL for /apple and another for /apple-0.
Then I visit the two term pages and click edit. At this point, there is no information regarding which vocabulary that term belongs to.
Proposed resolution
Display the vocabulary name in the breadcrumb when editing a term. Optionally also align the breadcrumb of the Add term form with the Edit term form.
Remaining tasks
Get the vocabulary name when editing the termDisplay the information on the form- Adapt the existing patch for the changes interface introduced in #2292025: Convert BreadcrumbBuilderInterface applies() and build() to use RouteMatch
- Optionally also alter the breadcrumb for the Add term form
User interface changes
Breadcrumb of the Edit term includes the link to the vocabulary.
Comment | File | Size | Author |
---|---|---|---|
#66 | taxonomy-term-edit.jpg | 25.05 KB | yoroy |
#61 | show_vocabulary-1905370-61.patch | 3.52 KB | siva_epari |
#61 | interdiff-49-61.txt | 2.06 KB | siva_epari |
#49 | show_vocabulary-1905370-49.patch | 3.39 KB | marcelovani |
#46 | show_vocabulary-1905370-46.patch | 3.4 KB | marcelovani |
Comments
Comment #1
marcelovaniI have created a patch, see screenshot
If it gets applied to core, I will do the same for 8.x
Comment #2
marcingy CreditAttribution: marcingy commentedFeatures get added to latest version first and needs review indicates a patch exists.
Comment #3
Ravi.J CreditAttribution: Ravi.J commentedThis is a very useful feature to have. I have had similar problems in the past.
From the screenshot Breadcumb should also say Home >> Fruits >> Banana
Comment #4
marcelovaniI forgot to attach the patch, will do for 8.x first then 7.x, cheers
Comment #5
marcelovaniAdding patch for 8.x, which includes the change on breadcrumb (see screenshot)
Comment #6
marcelovaniDrupal 7 patch here http://drupal.org/node/1906244#comment-7017972
Comment #7
marcingy CreditAttribution: marcingy commentedWhy is the minimum php version being changed in this patch?
Variables should not go through t(). Similar issues in the breadcrumb code.
Comment #8
marcelovaniOops, the PHP version was a debugging thing, should not have gone to the patch, will fix it.
Comment #9
marcelovaniComment #11
marcelovani#9: show_vocabulary-1905370-9.patch queued for re-testing.
Comment #12
blairski CreditAttribution: blairski commentedLooks good and a very handy feature. Shouldn't
<strong>
be used instead of<b>
in #markup?Comment #13
marcelovani@Blairski I have changed
<b> to <strong>
Comment #14
marcingy CreditAttribution: marcingy commentedThis looks good to me
Comment #15
webchickThis looks like a useful UX enhancement. I'm re-categorizing as a task rather than a feature though, because it's pretty straight-forward.
However, we need automated tests that show the functionality works as expected. See http://drupal.org/simpletest or drop by core mentoring hours if you need a hand!
Comment #16
PawelR CreditAttribution: PawelR commentedRe rolled patch with test included.
Comment #17
noels CreditAttribution: noels commentedI ran all TAXONOMY TERM FUNCTIONS AND FORMS tests which pass.
Comment #18
marcingy CreditAttribution: marcingy commentedDoes not meet drupal coding standards also no need for a message to be supplied just let the assert return the default message.
Comment #19
PawelR CreditAttribution: PawelR commentedpatch without a message
Comment #20
marcingy CreditAttribution: marcingy commentedLooks good.
Comment #21
marcelovaniWhen applying the patch I had these errors
git apply ../show_vocabulary-1905370-19.patch
../show_vocabulary-1905370-19.patch:18: trailing whitespace.
}
../show_vocabulary-1905370-19.patch:19: trailing whitespace.
../show_vocabulary-1905370-19.patch:34: trailing whitespace.
Comment #22
marcelovaniI am not sure that the test in #19 is actually checking the purpose of this issue.
It is checking for a link 'Add term' when editing a vocabulary where it should check for a link to the vocabulary when editing a term.
I have added the relevant test, please review.
Comment #23
marcingy CreditAttribution: marcingy commentedIt works because it is clicking the link and ensuring a page is loaded with the link
Your test works equally as well as it is checking for the presence of the link and not following it. Either version works assuming this comes back green it is RTBC. And nice catch on the white space I missed those before when doing an eyeball review :)
Comment #24
PawelR CreditAttribution: PawelR commentedPlease correct me if I'm wrong but is it not better to test if link is actually working and it's not broken (by going to vocabulary page and testing content there) than just simply test presence of the link on term page?
Comment #25
marcelovaniThe patch on #19, #24 does the following:
Goes to the vocabulary page. i.e. /admin/structure/taxonomy/fruits
$this->drupalGet('admin/structure/taxonomy/' . $this->vocabulary->id());
Clicking on the link to the vocabulary will keep you on the same page as the link is on the LIST tab
$this->clickLink($this->vocabulary->name);
Checks that there is a link to 'Add term' on the vocabulary page
$this->assertLink(t('Add term'));
// Go back to term page.In fact you go back to Vocabulary edit$this->clickLink(t('edit'));
Please review this, there is no test for the actual issue's purpose, which is to test the link to the Vocabulary when editing a Term
i.e.
If you have a vocabulary called 'fruits', and fruits has a term called 'banana'.
When you are on taxonomy/term/2/edit you will have a breadcrumb: Home > Fruits > Banana
The test needs to check that there is a link to Fruits
Please correct me if #22 doesn't do that
Comment #26
noels CreditAttribution: noels commentedI prefer the patch in #24. It does what #22 does, but it also tests the link is working.
You say:
Clicking on the link to the vocabulary will keep you on the same page as the link is on the LIST tab
$this->clickLink($this->vocabulary->name);
I see the link on the EDIT page. Clicking the link takes you to the term list. The test in #24 should be adopted.
Comment #28
PawelR CreditAttribution: PawelR commented#24: show_vocabulary-1905370-24.patch queued for re-testing.
Comment #30
PawelR CreditAttribution: PawelR commentedre-rolled patch #24
Comment #31
dudycz CreditAttribution: dudycz commentedI also think that test in #30 is better, it definitely checks the link on term page.
Comment #32
marcelovaniCool
Comment #33
marcelovaniHow can we get this committed? I have the patch for D7 ready and we need this functionality on our D7 sites as soon as possible.
Comment #34
xjm#30: show_vocabulary-1905370-30.patch queued for re-testing.
Comment #35
xjmOkay, it won't let me embed the screenshots for some reason, but they're in #0 (before) and #1 (after).
Comment #36
webchickYou know...
Looking at this again after some time away, I'm wondering if we want to do exactly this. It seems to introduce inconsistency with what we do at e.g. menu links, which are also hierarchical. There, the method of informing you what menu you're editing is merely by changing the breadcrumb to include it: Home >> Administration >> Structure >> Menus >> Main navigation
I'm actually thinking it would be better if we were just to do that much of the patch, and not also the part of entering a new form element above Name, which is generally the very first element in a form, so it's a bit odd for it not to be here.
Tagging for the UX team to chime in.
Comment #37
marcelovaniI agree with the comment about inconsistency in coding. Please review now.
Regarding displaying the additional element, I think you are right, and on the top of that we don't need to have the same information twice.
Comment #38
marcelovaniRe-rolled the patch for 8.x
Comment #40
marcelovaniComment #41
marcelovani38: show_vocabulary-1905370-38.patch queued for re-testing.
Comment #43
Gábor HojtsyThe changes look good, but one of the sets of fails is this which looks suspiciously related:
It is pretty clearly related to the taxonomy term edit page, which looks to return a 200 response but not have the term there? This may be due to prior tests finding it in the breacrumb (instead of the form?). If you run the test locally, you will get debug page output for these fails so you can check what is going on there.
Comment #44
marcelovaniOk lets try again
Comment #45
Gábor HojtsyGreat, so you added the link to the term, so now it works again :) Looks good to me. This should improve the velocity of taxonomy administration a lot.
Comment #46
marcelovaniI found a problem where terms with parents didn't display the breadcrumb properly.
I have added a test to make sure breadcrumb shows home >> vocabulary >> parent term >> term.
Comment #47
marcelovani46: show_vocabulary-1905370-46.patch queued for re-testing.
Comment #49
marcelovaniRe-rolled the patch
Comment #50
znerol CreditAttribution: znerol commentedThis is a very useful addition, indeed. The patch applies and the breadcrumb works like a charm on the term edit page. However when adding a term, the breadcrumb is different. For example when clicking the vocabulary name, I end up on the vocabulary edit page.
It would be great when the term-edit and the term-add breadcrumbs would work the same way.
Comment #51
marcelovaniHi znerol,
I see what you mean. Please note that the urls are also different.
Drupal by default has the following:
The page /taxonomy/term/1/edit has breadcrumb Home > t1
The page /admin/structure/taxonomy/manage/tags/add has breadcrumb Home > Administration > Structure > Taxonomy
If you want to propose these changes, perhaps it should part of a separate issue.
Comment #52
marcelovaniIs it possible to squeeze this issue in?
Comment #53
znerol CreditAttribution: znerol commentedNeeds a reroll after #2292025: Convert BreadcrumbBuilderInterface applies() and build() to use RouteMatch.
@marcelovani: Is there any technical reasons against #50?
Comment #54
marcelovaniNot really. My only concern was that proposing a change in the API would incur extra debating and delay the acceptance of the patch.
But now they have changed the whole codebase in a way that the patch no longer applies anyway.
That said, we could either create a new issue and link to this one or change the topic of this issue and propose the changes you mentioned.
Comment #55
znerol CreditAttribution: znerol commentedI'm willing to continue reviewing / RTBC this. I leave the decision whether or not to include #50 to the person working on this patch and to the person who eventually will commit it. The patch already has been rejected once because of consistency reasons (see #36), therefore I think it would be smart to at least give it a try. If it is easy then do it, if not then let's open a follow-up.
Modifying the breadcrumb is not considered an API change, so no need to fear rejection because of that. The issue summary needs an update anyway to reflect #37.
I am not 100% sure whether this patch can be included in 8.0.x based on Beta changes policy. I think it should be possible because it was RTBC several times way before the beta deadline.
Comment #56
marcelovaniI agree with all you said.
The thing is, I have spend too much time with this issue, which is rather simple.
But unfortunately it has taken so much time that I can no longer spend any time on this, as I am busy with other work.
If anyone is interested in continuing with it, please feel welcome.
Comment #57
znerol CreditAttribution: znerol commentedComment #58
Shreya Shetty CreditAttribution: Shreya Shetty commentedI guess the issue which marcelovani is talking in #51 has a patch already .That can be found on https://www.drupal.org/node/2400543
Comment #59
jibranFrom #50
This issue will be irrelevant once #1340500: Merge "list terms" page into "edit vocabulary" page is fixed.
Comment #60
jibranAlso see #2428261: Breadcrumbs on Taxonomy add page take you back to the Edit not List page for #50.
Comment #61
siva_epari CreditAttribution: siva_epari commentedChanges of TermBreadcrumbBuilder.php moved to PSR-4 file location(Check interdiff).
Patch rerolled.
Comment #64
yoroy CreditAttribution: yoroy commentedComment #66
yoroy CreditAttribution: yoroy commentedCould the link to the vocabulary be shown in the description of the field? More compact and closer to the term field itself:
(The other arrow is for pointing out that yes, the breadcrumb needs fixing too)
Comment #67
pixelmord CreditAttribution: pixelmord at Wunder for Hubert Burda Media commentedRegarding #66 I think it is a good idea to put some explanatory text somewhere, but the text underneath the field is by default reserved for the field's description/help text and that is totally up to the site-builder to set that.
I would suggest that it could very well done also in this issue: #2596207: More specific titles for term and vocabulary edit forms where we could set the title lieke so:
Edit term "Apple" in "Fruits" vocabulary
Then it would be not so bad that someone could override/change the description
Comment #68
pixelmord CreditAttribution: pixelmord at Wunder for Hubert Burda Media commentedComment #70
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedSounds like it's necessary to choose between this issue and #2596207: More specific titles for term and vocabulary edit forms? It is hard to imagine doing both of them.
Comment #71
David_Rothstein CreditAttribution: David_Rothstein as a volunteer commentedWell, I take that back - to the extent this issue is about fixing the confusing breadcrumbs, it makes sense to do no matter what. But in that case it should probably be retitled.
Comment #74
PanchoPer #71