Too many forums can make a site unusable. We have a site that has over 3,000 forums and the initial forum page load takes forever. Once you have drilled-down to sub-forums, things speed up somewhat. This patch gives an option to limit the number of forums displayed on the main screen so that only one level of forums are displayed (sub-forums are not displayed until you drill-down into their parent).

The patch consists of two pieces, one modification to the forum.admin.inc that adds a check-mark option to enable this bug-fix. The other is the modification to forum.module which, when the check-mark is selected, returns only the top-level forums for the level one is looking at.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dddave’s picture

Status: Active » Needs review

Not sure if this is a bug or a feature request...

tyoungls’s picture

For us, it is a bug. Our site becomes slow to the point of unusability without this. We programmed the "fix" to appear as a feature, because it changes the look and feel in a way that not everyone wants. Not everyone will want this "bug fix" the way it is implemented because of the change in look/feel, so you can selectively enable/disable it. Those of us with massive numbers of forums and sub-forums will highly appreciate the increase in speed of not generating one page that lists all the forums at once. It is much easier to navigate this way than by simply putting a paging system on the top-level.

So, for us it is not a bug that makes the site go "boom" or a security glitch that allows hackers in. But it is a bug that turns our fluid site into a frozen mass, literally taking minutes to load some pages. Maybe taking minutes to load is considered a "feature" by some, but for us, it is a bug. Therefore, the fix for us is a "bug fix." I can completely understand if you all do not see it as such. Very few people have a site with as many forums as we have, and so it is probably a very rarely encountered "bug". For most other people, this will simply be a change in appearance and navigation, instead of a matter of life and death. For them, it is a feature.

I can see people perceiving this either way. Almost a year ago I posted this as a "new feature" and the response was, "new features are only being added to the next version." They said to upgrade to 7 and re-submit the request. We were not at a spot where we wanted to upgrade to the beta version, so we have just kept applying the security releases, re-applying this fix of ours. We would love it if it were a "bug" that could be applied to the version 6, or even considered a feature, but still applied to version 6.

dddave’s picture

I said that completely free from any judgment and I find it great that you provide your fix back to the community. I am in no position to review your code but I really hope someone with the necessary skills takes notice.

tyoungls’s picture

Thanks. It is nice that someone at least noticed it. :)

Jody Lynn’s picture

Title: Too many forums can make a site unusable » Option to not display subforums on main forum listing
Version: 6.16 » 8.x-dev
Category: bug » feature
Status: Needs review » Needs work

I don't believe core forum module was designed to handle 3,000 forums, so making it more robust is a feature request not a bug, and features need to be added first to 8.x now.

pumpkinkid’s picture

I too would like to see this feature... If as Jody Lynn says, Drupal Forums was not meant to handle so many forums, then it needs to be able to do so...

I haven't yet looked at the code in the patch... but could this be made into a module?

I myself am new to creating modules, however, wouldn't mind taking a crack at it seeing as I too want this feature...

pumpkinkid’s picture

As I said, not very well versed in creating modules... however, wouldn't an implementation of the forum_get_forums() hook allow the same type of modification at the module level?

alexweber’s picture

Status: Needs work » Active

Decided to take this one on, the patch seems pretty solid just need to tweak it for D7 compatibility

alexweber’s picture

Status: Active » Needs review
FileSize
3.88 KB

patch attached!

it's pretty much the same basic idea from the original patch but instead of an on/off checkbox to limit depth, I added a select where you can specify the depth, from 0 (disabled) to 10.

alexweber’s picture

FileSize
2.01 KB

despite passing the test the patch had an error where i incorrectly incremented the depth counter, updated patch attached.

DevElCuy’s picture

Status: Needs review » Reviewed & tested by the community

I love this feature!

DevElCuy’s picture

Status: Reviewed & tested by the community » Needs work

Patches at #9 and #10 need to be merged.

alexweber’s picture

Status: Needs work » Reviewed & tested by the community

@develCuy, patch #10 is already a merged version of both! It looks smaller because patch #9 included some unecessary commits because I first made the setting a checkbox and then later, in another commit, made it into a select box.

Patch #10 goes straight to the select approach! :)

Should be good to go!

DevElCuy’s picture

Status: Reviewed & tested by the community » Needs work

Great job! I confirm that the patch works, now it needs the unit test.

alexweber’s picture

Status: Needs work » Active

Fair enough, test comming up! :)

alexweber’s picture

Status: Active » Needs work

Writing the test is blocked by #1374152: Allow forum_forum_load() to force static cache reset.

Otherwise the patch seems to be solid, but we need the test... right?

DevElCuy’s picture

Issue tags: +dlatino

Adding tag "dlatino" for reference of the Drupal Latino community.

edutrul’s picture

Status: Needs work » Reviewed & tested by the community

No need to make a test. Good to go!

oriol_e9g’s picture

Istead of:

array(0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 10);

You can use:

range(0, 10);

It's shorter an easier to maintain.

Plus: There is a bug in the sequence, see 8, 8 --> 8, 9.

oriol_e9g’s picture

Status: Reviewed & tested by the community » Needs work
alexweber’s picture

Status: Needs work » Needs review
FileSize
1.98 KB

@oriol_e9g attached patch with the range() implementation, don't understand what you mean by the sequence thing.

oriol_e9g’s picture

@alexweber I said that in #10:

+  $depths = drupal_map_assoc(array(0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 10));

there were two eights and none nine! look carefully!

...but this is solved in #21 using the range();

alexweber’s picture

@oriol_e9g, awesome!

xuruo’s picture

can this patch used in version 7.x?

Status: Needs review » Needs work

The last submitted patch, 21: forum-783230-21.patch, failed testing.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.2.x-dev

Drupal 8 is end-of-life as of November 17, 2021. There will not be further changes made to Drupal 8. Bugfixes are now made to the 9.3.x and higher branches only. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.2.x-dev » 9.3.x-dev

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.15 was released on June 1st, 2022 and is the final full bugfix release for the Drupal 9.3.x series. Drupal 9.3.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.4.x-dev branch from now on, and new development or disruptive changes should be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.9 was released on December 7, 2022 and is the final full bugfix release for the Drupal 9.4.x series. Drupal 9.4.x will not receive any further development aside from security fixes. Drupal 9 bug reports should be targeted for the 9.5.x-dev branch from now on, and new development or disruptive changes should be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Issue summary: View changes
Status: Needs work » Postponed

Forum 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.

Version: 9.5.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.