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.
If you go to /user/1/activity on the Title column, the content is displayed as plain text and not as a link.
e.g.
<a href="/drupal8/node/1">Cathedral</a>
just displays as is instead of as a link.
Comment | File | Size | Author |
---|---|---|---|
#20 | interdiff-2322439-19-20.txt | 1.25 KB | subhojit777 |
#20 | titles_in_a_user_s-2322439-20.patch | 3.67 KB | subhojit777 |
#16 | Screenshot from 2014-11-15 12:07:25.png | 20.57 KB | jaime@gingerrobot.com |
#14 | interdiff-2322439-10-14.txt | 2.21 KB | subhojit777 |
#14 | titles_in_a_user_s-2322439-14.patch | 2.28 KB | subhojit777 |
Comments
Comment #1
ThomWilhelm CreditAttribution: ThomWilhelm commentedReplicated issue locally. Submitting proposed patch to fix this issue.
Comment #2
znerol CreditAttribution: znerol commentedReproduced on a fresh install, it looks like we are lacking test coverage here, tagging.
Comment #3
star-szrUnassigning, based on the other issues created by @japo32 I don't think they intended to work on the patches. Please correct me if I'm wrong!
Because this needs tests setting to needs work.
Comment #4
star-szrAlso setting the correct parent relationship.
Comment #5
star-szrAhem.
Comment #6
perennial.sky CreditAttribution: perennial.sky commentedIn previous patch l function is directly, but now l function is used with drupal static class as core changes.
Reroll patch, thanks Cottser for mentoring.
Comment #7
perennial.sky CreditAttribution: perennial.sky commentedComment #8
jibranComment #9
znerol CreditAttribution: znerol commentedStill needs tests. Also it seems that the link to new comments is also affected by the same problem.
Granted that cell
data
takes render arrays, wouldn't it be appropriate to supply a proper'#type' => 'link'
element instead of#markup
?Comment #10
perennial.sky CreditAttribution: perennial.sky commentedHere is the patch which remove title and replies section.
Comment #11
perennial.sky CreditAttribution: perennial.sky commentedYeah i agree with you that we should use '#type' => 'link' element instead of #markup?, if we implement this then we have to change in many places and that's not a feasible way.
Comment #12
Fabianx CreditAttribution: Fabianx commentedUsing #markup is not the right fix.
This just hides the problem ...
The string needs to come from a function that creates safe markup.
Also \Drupal::l is deprecated, so using #type => link is what should happen here.
Comment #13
subhojit777Comment #14
subhojit777Here is the patch according to suggestions from @Fabianx in #12. Will work with tests soon.
Comment #15
subhojit777Invoking tests.
Comment #16
jaime@gingerrobot.com CreditAttribution: jaime@gingerrobot.com commentedHere is what it looks like with patch applied:
Comment #17
jaime@gingerrobot.com CreditAttribution: jaime@gingerrobot.com commentedSo I was just looking at this ticket https://www.drupal.org/node/2309737 which asks to remove direct format_plural calls with function from the translation object: IE:
\Drupal::translation()->formatPlural()
So this patch will need to be updated so that it doesn't conflict with the other patch.
Comment #18
subhojit777Comment #19
subhojit777Thanks @jaimekristene for pointing this out. Here is the corrected patch. Can anyone help me with tests. I guess I have to write simpletests for this since we will carry out tests in a virtual instance.
There are
tracker_test_views.info.yml
andviews.view.test_tracker_user_uid.yml
, but I think they are for views.Comment #20
subhojit777Patch with tests added.
Comment #21
subhojit777Comment #22
znerol CreditAttribution: znerol commentedApplied the patch and verified manually that it is working. Also executed the test from #20 locally without the rest of the patch and the new assertions fail, which shows that they are working as intended.
Comment #23
Fabianx CreditAttribution: Fabianx commentedRTBC + 1 - looks great
Comment #24
alexpottThis issue is a normal bug fix, and doesn't include any disruptive changes, so it is allowed per https://www.drupal.org/core/beta-changes. Committed 390315b and pushed to 8.0.x. Thanks!