Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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 CreditAttribution: abhishek.kumar commentedAdding patch file.
Comment #3
abhishek.kumar CreditAttribution: abhishek.kumar commentedUpdated patch.
Comment #4
abhishek.kumar CreditAttribution: abhishek.kumar commentedComment #5
abhishek.kumar CreditAttribution: abhishek.kumar commentedComment #6
piyuesh23 CreditAttribution: piyuesh23 commentedCode looks good. Error applying patch due to trailing whitespaces.
Comment #7
abhishek.kumar CreditAttribution: abhishek.kumar commentedUpdated patch for white spaces error.
Comment #11
abhishek.kumar CreditAttribution: abhishek.kumar commentedUpdated patch.
Comment #13
abhishek.kumar CreditAttribution: abhishek.kumar commentedUpdated patch for translation.
Comment #14
Nitesh Pawar CreditAttribution: Nitesh Pawar commentedOptimized patch.
It make sense to show parents on edit and delete also.
Comment #18
Nitesh Pawar CreditAttribution: Nitesh Pawar commentedUpdated patch
Comment #19
argosbass CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: pec commentedRemoved
+use Drupal\Core\Url
from #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 CreditAttribution: pec commentedSure, here it is.
Comment #29
jibranOh i see now. NW for tests.
Comment #30
meramo CreditAttribution: meramo commentedLet's submit a clean patch and retest once again. Good work!
Comment #31
PieterJanPut CreditAttribution: PieterJanPut at iO commentedComment #32
meramo CreditAttribution: meramo commentedTested against the current HEAD. Works great.
Comment #33
chegor CreditAttribution: chegor commentedTested. Looks ok.
Comment #34
jibranPlease post a test only patch to show the fails.
Comment #35
PieterJanPut CreditAttribution: PieterJanPut at iO commentedComment #36
VaithianathanV CreditAttribution: VaithianathanV commentedTest only patch does not fail
indent is wrong
Comment #37
ashutoshsngh CreditAttribution: ashutoshsngh at Srijan | A Material+ Company 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 CreditAttribution: disasm at AppliedTrust commentedLets get the issue summary updated and screenshots added.
Comment #43
cglewis07 CreditAttribution: cglewis07 as a volunteer commentedComment #44
Scott Weston CreditAttribution: Scott Weston commentedComment #45
chuta CreditAttribution: chuta commentedOk am going to work on this issue.....Drupalcon LA Sprint!
Comment #46
Scott Weston CreditAttribution: Scott Weston commentedComment #49
cilefen CreditAttribution: 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 CreditAttribution: JmOkay as a volunteer commentedComment #51
JmOkay CreditAttribution: JmOkay as a volunteer commentedComment #52
JmOkay CreditAttribution: JmOkay as a volunteer commentedComment #53
JmOkay CreditAttribution: JmOkay as a volunteer 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 CreditAttribution: JmOkay as a volunteer 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 CreditAttribution: JmOkay as a volunteer 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 CreditAttribution: dman at Sparks Interactive 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: 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 CreditAttribution: cilefen commentedWould someone please rewrite the issue title to explain what this issue is actually about?
Comment #68
Sagar Ramgade CreditAttribution: Sagar Ramgade as a volunteer commentedMakes sense?
Comment #69
cilefen CreditAttribution: cilefen commentedThat is much improved!
Comment #71
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedNew Patch on Latest revision.
Comment #72
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #73
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #74
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #75
ameymudras CreditAttribution: ameymudras as a volunteer commentedAdding tests for this issue
Comment #76
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd 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 CreditAttribution: cilefen commentedWhoever makes the next patch, please remove these unrelated changes.
Comment #79
cilefen CreditAttribution: 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 CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #81
Truptti CreditAttribution: Truptti at Axelerant 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 CreditAttribution: cilefen commented@Truptti Please embed the before and after snapshots in the issue summary.
Comment #83
ameymudras CreditAttribution: ameymudras as a volunteer commentedThe above patch works great, looks like RTBC to me
Comment #84
Truptti CreditAttribution: Truptti at Axelerant commentedComment #85
Truptti CreditAttribution: Truptti at Axelerant commentedComment #86
Truptti CreditAttribution: Truptti at Axelerant commentedComment #87
jibranLet's ask committer's
Comment #88
wuinfo - Bill Wu CreditAttribution: 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 CreditAttribution: hugronaphor as a volunteer and at Dennis for Dennis commentedLatest patch include:
- Fixed indentation;
- Moved the test for checking the breadcrumb on term delete page in the correct place;
Comment #94
cilefen CreditAttribution: 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 CreditAttribution: 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\Html
so 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 & wine
appears 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 CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #100
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd 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 CreditAttribution: ameymudras as a volunteer 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 CreditAttribution: ameymudras as a volunteer commentedComment #104
cilefen CreditAttribution: 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 CreditAttribution: hugronaphor as a volunteer and at Dennis for Dennis commentedIt may be too hardcore, but the name for the term may be:
Foo <>&"' bar
Comment #106
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedcreated separate Term Breadcrumbs test
Comment #107
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd commentedComment #108
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd 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 CreditAttribution: hugronaphor as a volunteer and at Dennis for Dennis commentedI can't answer the @dawehner's question but here is the patch which removes unneeded steps which are available in
testTermInterface
Comment #111
cilefen CreditAttribution: 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 CreditAttribution: hugronaphor as a volunteer and at Dennis for Dennis commentedI'm with you @cilefen
Comment #113
hugronaphor CreditAttribution: hugronaphor as a volunteer and at Dennis for Dennis commentedShould we change the status to "Reviewed & tested by the community" ?
Comment #114
hugronaphor CreditAttribution: hugronaphor as a volunteer and at Dennis for Dennis commentedComment #115
cilefen CreditAttribution: cilefen commentedNo, there is an unanswered question in #109.
Comment #116
hugronaphor CreditAttribution: hugronaphor as a volunteer and at Dennis for Dennis 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 CreditAttribution: cilefen commentedDisabled tests
Comment #123
lauriiiEnabled the tests again
Comment #124
cilefen CreditAttribution: cilefen commentedComment #125
Nitesh Pawar CreditAttribution: Nitesh Pawar at Trigyn Technologies Ltd 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