Problem/Motivation
Drupal allows a forum to appear in multiple containers via the taxonomy module. This is great because some forums can be classified into multiple categories (containers). However, it does not display the mulitple classified forum correctly at the top hierarchy level (first level). It only shows the first instance of the forum in the first container that it appears. However, when one clicks on the other containers containing the multiple classified forum, Drupal will display the containers' forums including the one that was originally not visible, the multiple classified forum. Drupal should be more consistent and display the multiple classified forum in all containers at all hierarchy levels. Or at the very least, make it a feature to enable or disable this.
Additional problem was uncovered in comment#11. [If I understood it, I would explain what it was.]
Proposed resolution
See comment #21 for proposed solution.
Remaining tasks
Write code for feature to enable single forum to be related to multiple containers.
Write some tests.
User interface changes
Forum containers work properly with the same forum in multiple containers.
API changes
None.
Original report by The Directive
Drupal allows a forum to appear in multiple containers via the taxonomy module. This is great because some forums can be classified into multiple categories (containers). However, it does not display the mulitple classified forum correctly at the top hierarchy level (first level). It only shows the first instance of the forum in the first container that it appears. However, when one clicks on the other containers containing the multiple classified forum, Drupal will display the containers' forums including the one that was originally not visible, the multiple classified forum. Drupal should be more consistent and display the multiple classified forum in all containers at all hierarchy levels. Or at the very least, make it a feature to enable or disable this.
Comment | File | Size | Author |
---|---|---|---|
#18 | forum-10566.patch | 1.9 KB | alexweber |
#11 | Multiple-forum-containers-10566.patch | 556 bytes | larowlan |
#4 | 10566.patch | 623 bytes | Jody Lynn |
#4 | Screen shot 2010-08-06 at 12.33.03 PM.png | 34.58 KB | Jody Lynn |
#4 | Screen shot 2010-08-06 at 12.32.21 PM.png | 22.54 KB | Jody Lynn |
Comments
Comment #1
Bèr Kessels CreditAttribution: Bèr Kessels commentedComment #2
Uwe Hermann CreditAttribution: Uwe Hermann commentedComment #3
Liam McDermott CreditAttribution: Liam McDermott commentedComment #4
Jody LynnThis five year old issue is a bug and there is a simple fix.
To reproduce:
Create two forum containers and one forum (admin/structure/forum). Then go to taxonomy and edit the term for your new forum, placing it into multiple containers. Go to /forum and the forum only is displayed in one of the containers, even though it truly is in both. (Screenshots attached)
Cause:
function forum_forum_load (which is only called for this page, at least in its full usage), starts out with the proper taxonomy tree of forums, but then loops through and creates a new array which it keys by taxonomy term (preventing the same term being used multiple times). This key is never used and removing it fixes the problem.
Comment #5
andypostIs there any reason to allow same forum to appear in different containers?
Suppose we should disable this feature for forum vocabulary
Comment #6
Jody LynnYeah, that's the other option. We could form_alter the taxonomy settings to not allow putting forums in multiple containers. But then we're dealing with slightly unique behavior in a certain vocabulary, which is a little odd, as opposed to what seems like a very simple fix.
Comment #7
andypostI think that this form should be altered anyway because #599016: Only allow nodes to be posted to forums
Comment #8
yoroy CreditAttribution: yoroy commentedHello new forum maintainer, look what I found :)
Comment #9
larowlanThanks yoroy, do we have a straw poll on this wrt to which way to go.
My performance is to allow multiple parents.
Comment #10
yoroy CreditAttribution: yoroy commentedI had to read again to understand correctly. You definately want to be able to post a single forum post to multiple forum containers (for an important message that applies to all visitors of any forum container). But that's not the issue here.
From a UX perspective I would advise to remove the possibility to do this. Although the capability could be viewed as a feature, it is more likely to be confusing than useful.
Comment #11
larowlanTurns our there's code in the module to do just this - ie remove the ability to edit the hierarchy field on the vocabulary and add multiple parents to the term - however the code is targeting a non existent field.
The problem is with this bit
Because there is no such $form['advanced'], instead it is $form['relations'].
Attached patch fixes this.
Comment #12
marcingy CreditAttribution: marcingy commentedI agree with yoroy this is a feature request not a bug
Comment #13
andypostForm container is changed from 'advanced' to 'relations' so this should be commited asap and backported
taxonomy_form_term() D7 & D6
Comment #14
catchNeeds tests, not a major bug at least.
Comment #15
larowlanPossibly the cause of
#361275: Topics are created but not displayed and
#345387: Forum topic will not display
Users there have described irregular formats for $node->taxonomy which could be down to the vocab/terms being setup wrong (ie not locked down).
Comment #16
sunAs @catch mentioned in #14, needs tests.
Comment #17
larowlanNotes on how this test would go:
1) Load up the term edit form for a tid in the forum vocab (install hook creates one term - General)
2) Assert that the parent field is not found.
Comment #18
alexweber CreditAttribution: alexweber commentedre-rolled the patch in #11 with the tests described in #17 (patch in #11 comitted with proper attribution)
Comment #19
andypost#11 should be commited asap or should go to another issue because it's really bug!
But this issues is about different - is forum allowed to be in different containers.
This test make no sense because does not tests #11 and ability for forum to live in different containers.
trailing whitespace
no dots at the end if comments
Comment #20
catchLet's commit the bug fix and the test at the same time, so this needs work to address andypost's review of the test.
Also it looks like the bug fix is nothing to do with the initial report, so we could use an issue summary.
Comment #21
-enzo- CreditAttribution: -enzo- commentedHello guys
I was debugging this bug with Koffer this bug for Drupal 7 and we think we found the source of the problem.
The problem: The template structure
The forum list template expect an array structure in the way listed below
container 1
child-A
child-B
container 2
child-A
child-C
Notice the child-A is the same term and must list listed twice in the same array, also notice containers and children are in the same level of array , they are only separated by is_container variable.
The problem is the array structure is returned by the function taxonomy_get_tree($vid, $tid); inside function forum_forum_load of file forum.module. Below and example of returned array
container 1
child-A ( parents: container 1, container 2)
child-B
container 2
child-C
The solution
A) Replace the function taxonomy_get_tree($vid, $tid); inside function forum_forum_load of file forum.module.
B) Change the logic of forum list template: forum-list.tpl.php
We will try to propose a solution for D7.
Regards,
Comment #22
andypostLet's leave this issue about #21 - templates and logic
Because current form_alter is broken - I've posted a patch with #18 and another fix in #787652: Forum vocabulary alterations possibly obsolete -- possible to delete forum vocab
We should not test for unused component
Comment #23
andypostI've make a split of forum_form_alter() with tests for vocabulary and term forms in #787652-8: Forum vocabulary alterations possibly obsolete -- possible to delete forum vocab
Not sure this possible for D7 (BC breakage) so for D7 we could live with forum_form_alter().
@larowlan as forum maintainer please take into account that tasks of this issues are different. This about abiliti of forum to live in different containers which means more about queries and templates but #787652 is about currently broken forum_form_alter()
Comment #24
Momseekingbalance CreditAttribution: Momseekingbalance commentedI just wrote an issue summary. Someone that knows more about this issue should check it over. Be kind, I am a new contributor. (jhodgdon was looking over my shoulder but may not know anything about this issue either)
Comment #25
andypost@momseekingbalance great summary!
First we need to fix #787652-10: Forum vocabulary alterations possibly obsolete -- possible to delete forum vocab
Comment #26
DevElCuy CreditAttribution: DevElCuy commentedAdding tag "dlatino" for reference of the Drupal Latino community.
Comment #27
andypostThis hunk needs re-roll
Comment #27.0
andypostI wrote an issue summary for your message.
Comment #32
g-brodieiProviding an update to summary after 8 years, the original issue is now unable to be reproduced on 8.0.x nor 8.9.x as it is fixed by other related issues (#787652, #588016), the functionality to assign one forum to different container is being disabled in the forum's create/edit form since the bug was fixed back to it's original intention. Test is being written as well to verify no parent fields to appear in term edit form in ForumTest.php line 355 (if I'm correct), thus the original bug is resolved and may be closed.
This issue should now be a feature request to allow same forum to appear in different containers.
container 1
forum 1
container 2
forum 1
forum 2
#21 has proposed a solution, still need work on D8. This feature should be discussed and decided on the usefulness of this feature, as mentioned by #9
Comment #37
quietone CreditAttribution: quietone at PreviousNext commentedForum is approved for removal. See #1898812: [policy] Deprecate forum module for removal in Drupal 11
This is now Postponed. The status is set according to two policies. The Remove a core extension and move it to a contributed project and the Extensions approved for removal policies.
It will be moved to the contributed extension once the Drupal 11 branch is open.
Comment #39
quietone CreditAttribution: quietone at PreviousNext commented