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.
On admin/structure/forum after creating a container and a forum, the Edit links take you to forum/id (i.e. the page where you can start adding discussions) rather than an edit page (which would let you edit the name/description of the forum).
Comment | File | Size | Author |
---|---|---|---|
#11 | forum-678526-11.patch | 1.34 KB | indytechcook |
#7 | forum-678526-2.patch | 1.33 KB | jrbeeman |
#6 | forum-678526.patch | 910 bytes | indytechcook |
#3 | 678526.patch | 1.29 KB | jhodgdon |
#2 | 678526.patch | 1.29 KB | jhodgdon |
Comments
Comment #1
jhodgdonAh.
The problem is in function forum_overview() in module/forum/forum.admin.inc.
It is asking taxonomy to build the edit page, and then attempting to modify the editing links, so:
However, if you look at $form, you find that both the 'view' and 'edit' components that are being modified have #type='link':
Then in http://api.drupal.org/api/function/drupal_pre_render_link/7 when this element is pre-processed, the #markup property added by our forum_overview function is being overwritten by the pre-processing step, so it goes back to what the Taxonomy module set up. So the forum module either needs to override the title/href propoerties, or set the type to markup, for this to work as intended.
Now it just needs a patch. :)
Comment #2
jhodgdonThis patch will probably do the trick... I'll make sure in a sec and make a screen shot, meanwhile letting the testing bot loose on it.
Comment #3
jhodgdonThis one works better.
Comment #4
Dries CreditAttribution: Dries commentedConfirmed that this patch fixes the bug. Committed to CVS HEAD. I'm marking this 'needs work' because we should have tests for this.
Comment #5
jhodgdonTests, what a good idea! So that if the structure of the taxonomy list changes again, the forum links won't break without us knowing about it? What a concept! :)
Sorry, must be punchy this morning.... I am seriously in love with the testing framework though, and I think getting that into D7 and setting up the test bot was the single greatest achievement for D7. Even better than Fields in Core, though that's a close second.
Comment #6
indytechcook CreditAttribution: indytechcook commentedHere is a patch with a test.
Comment #7
jrbeemanI've re-rolled the patch with:
- a different order of operations (last one was checking the container link after the container was deleted);
- added assertion messages;
- Reset the nav back to /admin/structure/forum
Test passes locally, but needs review.
Comment #8
baronmunchowsen CreditAttribution: baronmunchowsen commentedHi. I have reviewed the patch in #7. Test passes and looks good.
Comment #9
baronmunchowsen CreditAttribution: baronmunchowsen commentedchanging status
Comment #10
paulmckibbenThe above patch verifies that the links exist, and that they go *somewhere* (200 result code). However, they do not verify that the links actually go to the respective edit pages.
On lines 143 and 149, instead of assertResponse() (which only verifies the response code), I suggest that you use assertRaw() or assertPattern(), and verify the content returned by the clicked link. Perhaps look for the titles "Edit container" and "Edit forum" respectively.
Comment #11
indytechcook CreditAttribution: indytechcook commented@pmckibben. Agreed. I thought I did that in the patch. Looks like I took it out for some reason. This version has it.
Comment #12
paulmckibbenLooks great, indytechcook! Thanks!
Comment #13
jrbeemanLatest patch with test case was applied to a clean CVS checkout and verified to pass.
Thanks, @pmckibben - I was worried about that as well and wasn't sure the best way to check.
@indytechcook, nice work!
Comment #14
Dries CreditAttribution: Dries commentedLooks good. Code comments need to end with a point, so I added those and committed your patch to CVS HEAD. Thanks!
Comment #16
bobcallahan CreditAttribution: bobcallahan commentedI have tried to find the link structure so I can make the links in main menu "blank" "nofollow" so I can keep the consumer on the main content page. I have tried a couple of different things, but it breaks the site. Need to know where I can structure the site to blank meta tags.