Problem/Motivation
Breadcrumbs for taxonomy pages currently show term ids instead of term names.
Proposed resolution
Make Breadcrumbs for taxonomy pages show term names instead of term ids.
Remaining tasks
- write a fix for bug.
User interface changes
none
API changes
none
Data model changes
none
It's showing term id in breadcrumb instead of term name.
Before applying patch
After applying patch
| Comment | File | Size | Author |
|---|---|---|---|
| #124 | breadcrumb_should_be-2400543-124.patch | 5.75 KB | cilefen |
| #124 | interdiff.txt | 1.03 KB | cilefen |
| #123 | interdiff.txt | 2.81 KB | lauriii |
| #123 | breadcrumb_should_be-2400543-123.patch | 5.9 KB | lauriii |
| #121 | 2400543-121.patch | 8.78 KB | dawehner |
Comments
Comment #1
abhishek.kumar commentedAdding patch file.
Comment #3
abhishek.kumar commentedUpdated patch.
Comment #4
abhishek.kumar commentedComment #5
abhishek.kumar commentedComment #6
piyuesh23 commentedCode looks good. Error applying patch due to trailing whitespaces.
Comment #7
abhishek.kumar commentedUpdated patch for white spaces error.
Comment #11
abhishek.kumar commentedUpdated patch.
Comment #13
abhishek.kumar commentedUpdated patch for translation.
Comment #14
nitesh pawar commentedOptimized patch.
It make sense to show parents on edit and delete also.
Comment #18
nitesh pawar commentedUpdated patch
Comment #19
argosbass commentedTo replicate issue:
- Create a taxonomy term
- Edit or delete term created.
- You can watch tid on breadcrumb.
I applied patch on #18 and it's works.
Greetings from Costa Rica.
Comment #20
alexpottLooks like we could add a test for this.
Comment #21
jibranWe already have tests for all these pages we just need some link asserts in those tests.
Comment #22
jibranHere are the tests and test only patch.
Comment #23
jibranleft over :/
Comment #24
meramo commentedThe patch works good, however I think the breadcrumb link should point to the term page, not to term edit page, as it does now. Same logic as node breadcrumbs do
Comment #25
pec commentedRemoved
+use Drupal\Core\Urlfrom #23And changed the breadcrumb for edit and delete page to link to the term page as mentionned in #24
Comment #27
jibranIt does point to the term page. Have you used the one in #22?
Fix is fine as is we just need to fix the test. We need more breadcrumb specific(xpath) assert.
@pec can you please provide the interdiff?
Comment #28
pec commentedSure, here it is.
Comment #29
jibranOh i see now. NW for tests.
Comment #30
meramo commentedLet's submit a clean patch and retest once again. Good work!
Comment #31
pieterjanput commentedComment #32
meramo commentedTested against the current HEAD. Works great.
Comment #33
chegor commentedTested. Looks ok.
Comment #34
jibranPlease post a test only patch to show the fails.
Comment #35
pieterjanput commentedComment #36
VaithianathanV commentedTest only patch does not fail
indent is wrong
Comment #37
ashutoshsngh commentedFixed indent issue as mentioned in #36
Comment #38
jibranI think I got the test right this time.
Comment #41
jibranSo it fails because testbot doesn't use clean urls.
Comment #42
disasm commentedLets get the issue summary updated and screenshots added.
Comment #43
cglewis07 commentedComment #44
scott weston commentedComment #45
chuta commentedOk am going to work on this issue.....Drupalcon LA Sprint!
Comment #46
scott weston commentedComment #49
cilefen commentedBefore continuing coding work on this, please update the title to describe the issue and make use of the template to improve the issue summary.
Comment #50
JmOkay commentedComment #51
JmOkay commentedComment #52
JmOkay commentedComment #53
JmOkay commented#22
I'm wondering why an integration test was introduced instead of an PHPunit, when a unit test looks like it should cover this without the overhead of an integration test. If all okay, I was going to write a PHPunit test to cover this.
Comment #54
JmOkay commentedQuick update on the issue, it is a generic issue with Views overriding the Breadcrumb output. To replicate the fact that Views is changing the correct title to an tid, disable Views and the Bookmark title is correct.
Comment #55
JmOkay commentedComment #56
lauriiiThank you for working on this jmOkay!! I think now we need issue summary update even more than before
Comment #57
lauriiiI don't think this is good issue for novice anymore after the findings that has been made
Comment #58
dman commentedPoo. I just noticed this today and thought it looked like there would be a straightforward fix.
If it's views - what do we think the next steps for making progress here would be? Is all the work so far off-topic now?
I guess the *test* is at least still valid.
Comment #60
wuinfo - bill wu commentedDownload test patch from #38 and install and test it. It did not fail. So, queue for retest.
Comment #62
wuinfo - bill wu commented#38 test patch failed indeed. But it is not failed in the right place. So, I am afraid, we need to do something with the test patch.
Comment #63
wuinfo - bill wu commentedRedo the test patch.
1) Add the views module. According to #54
2) Remove the link validation. It can be added back soon the clean URL thing is fixed on the text bots. After all, this ticket is focusing the link text.
3) This patch is focusing on catch the term names error in the taxonomy term pages' breadcrumb.
Comment #64
wuinfo - bill wu commentedPut the new test patch on a test. Will work on combining the fixing and testing patch.
Comment #65
wuinfo - bill wu commentedHere is the patch, before we find a better fix on views module, maybe use it as a backup.
Comment #67
cilefen commentedWould someone please rewrite the issue title to explain what this issue is actually about?
Comment #68
sagar ramgade commentedMakes sense?
Comment #69
cilefen commentedThat is much improved!
Comment #71
nitesh pawar commentedNew Patch on Latest revision.
Comment #72
nitesh pawar commentedComment #73
nitesh pawar commentedComment #74
nitesh pawar commentedComment #75
ameymudras commentedAdding tests for this issue
Comment #76
nitesh pawar commentedRemoved some depricated functions
Comment #77
dawehnerCouldn't we also fix this by having a proper title callback on (taxonomy/term/1), I guess we don't have one yet as its a view?
Comment #78
cilefen commentedWhoever makes the next patch, please remove these unrelated changes.
Comment #79
cilefen commentedActually, in the first place, the edit and delete forms need better titles. The edit route could use this, for example:
That could be a separate issue. Someone, feel free to open one if none exists.
Comment #80
nitesh pawar commentedComment #81
Trupti Bhosale commentedVerified the patch in #80,breadcrumb on term edit and term delete page now display the term name instead of id.Attached snapshot for reference.
Comment #82
cilefen commented@Truptti Please embed the before and after snapshots in the issue summary.
Comment #83
ameymudras commentedThe above patch works great, looks like RTBC to me
Comment #84
Trupti Bhosale commentedComment #85
Trupti Bhosale commentedComment #86
Trupti Bhosale commentedComment #87
jibranLet's ask committer's
Comment #88
wuinfo - bill wu commentedNice, seems we do not have a core committer here in this thread. I will leave a message at irc for this issue.
Comment #89
alexpottComment #90
alexpottComment #91
xjmDiscussed with all the committers and we agreed this is an RC target!
Comment #92
alexpottThe code formatting here looks really odd - normally we indent by 2.
Missing test coverage for the delete route.
Comment #93
hugronaphor commentedLatest patch include:
- Fixed indentation;
- Moved the test for checking the breadcrumb on term delete page in the correct place;
Comment #94
cilefen commentedI think the array elements were indented once for being in an array and a second time for being inside a function parameter.
If it were me I would break the in_array() parameters onto separate lines for readability in a case like this. However, the core coding standards seem to leave it to the the coder's discretion.
Comment #95
mayurjadhav commentedPatch works for me, looks like RTBC to me.
Comment #96
alexpottFor some reason I'm not seeing automated tests on #93... re-uploading.
Comment #97
alexpottIn
TermBreadcrumbBuilder::build()we can moveinto the else as we only need to load the parents there.
Also lets add a use for
\Drupal\Component\Utility\Htmlso we can make the code more readable... ie.$breadcrumb->addLink(Link::createFromRoute(Html::escape(...Comment #98
alexpottWith the patch applied a term with the label
Cheese & wineappears asCheese & wine...Actually adding
\DrupalComponent\Utility\Html::escape()is not necessary - Twig will auto escape as necessary and this will cause double escaping. Can we ensure that we test the escaping of term name in breadcrumbs too - since making this incorrect change broke nothing.Comment #99
nitesh pawar commentedComment #100
nitesh pawar commentedLatest patch include:
- Removed Html::escape();
- Moved @todo with $parents code into else section.
Comment #101
alexpott@Nitesh Pawar - please learn how to make interdiffs - it makes it easy to see what has changed between two patches, see https://drupal.org/documentation/git/interdiff.
We need a test for ensuring that term names are escaped as expected in breadcrumbs.
Comment #102
ameymudras commented@alexpott not too sure but i think this is the way to test for escaping the breadcrumbs. Please let me know in case i am missing anything
Comment #103
ameymudras commentedComment #104
cilefen commented@ameymudras We need the new patches in addition to the interdiffs please.
Some HTML must be put in a breadcrumb to be sure it is escaped later.
Comment #105
hugronaphor commentedIt may be too hardcore, but the name for the term may be:
Foo <>&"' barComment #106
nitesh pawar commentedcreated separate Term Breadcrumbs test
Comment #107
nitesh pawar commentedComment #108
nitesh pawar commentedPlease ignore my previous patch(#106).
Comment #109
dawehnerCould views not also keep the existing _title_callback when it overrides the existing route?
Comment #110
hugronaphor commentedI can't answer the @dawehner's question but here is the patch which removes unneeded steps which are available in
testTermInterfaceComment #111
cilefen commentedMinor thing: There is an added period breaking up this sentence. I would remove the word "pure" because it is unnecessary and could be confusing.
Comment #112
hugronaphor commentedI'm with you @cilefen
Comment #113
hugronaphor commentedShould we change the status to "Reviewed & tested by the community" ?
Comment #114
hugronaphor commentedComment #115
cilefen commentedNo, there is an unanswered question in #109.
Comment #116
hugronaphor commented@dawehner ca you please expand your concerns/question ?
Comment #117
dawehnerLet's uninstall views. Once done you will see something like this:
The title we currently use is then coming from from the following route definition:
this is the entry which exists when you uninstall views:
As you see, all we actually have to do is to bring over that title callback to views and done.
Comment #118
dawehnerSo I would suggest this ...
Comment #119
marcelovaniCan you add the interdiff pls
Comment #120
alexpott@marcelovani #118 is a completely new approach.
It'd be great if the tests from #112 could be combined with #118 to prove we've fixed the original reported bug.
Comment #121
dawehnerSure.
Comment #122
cilefen commentedDisabled tests
Comment #123
lauriiiEnabled the tests again
Comment #124
cilefen commentedComment #125
nitesh pawar commentedI applied patch #124 on latest revision and it's works.
Comment #126
alexpottCommitted 4b64356 and pushed to 8.0.x and 8.1.x. Thanks!
Comment #129
alexpott