Containers and topics not showing

Created on 24 June 2025, 4 months ago

Problem/Motivation

I cannot get forum structures to show. If I go to a forum it does not show containers or topics, if I go to a container (from admin/structure/forum) it does not show the forum or topics and if I go to a topic (from admin/content) it does not show the forum or container.

πŸ’¬ Support request
Status

Active

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @johnwt
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Are you talking about /forum?

  • I am not sure what you are asking. If I go to /forum it does list the forums and containers but the topics and posts are all given as 0.
    If I go to a forum from there it lists containers but not any topics. If I then go to a container it does not list any topics.
    In short, topics are not being listed. Topics are being saved as nodes.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    The topics and posts are drawn from the forum index table and comment-statistics for the comment_forum field.

    Can you see if you have records in the comment_statistics database table for that field name, and matching records (using vid) in the forum table?

  • I am not sure what I am looking for. I don't seem to have a comment_statistics table, only comment_entity_statistics. The forum tables seem to be empty.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Might be simpler to jump in a call next week

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Things to check

    - does your forum node-type have a field on it called taxonomy_forums?
    - what is configured in forum.settings for the vocabulary - you can check this by using the single item export from admin/config/development/config or using drush with `drush cget forum.settings`
    -

  • - /admin/structure/types/manage/forum/fields has a field with the label Forums and machine name taxonomy_forums
    -

    drush cget forum.settings
    _core:
      default_config_hash: QIfZpz4g6BfEIyiL-WtauNYu31M8o3LvYlZ0VGRQtNo
    block:
      active:
        limit: 5
      new:
        limit: 5
    topics:
      hot_threshold: 15
      order: 1
      page_limit: 25
    vocabulary: forums
    
  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Ok, that all looks correct πŸ€”

    So I wonder why you're not getting records in the forum/forum_index table - that is where this data is read from.

    Was this a new site or a site that was migrated from an earlier version of Drupal?

  • The site was migrated from Drupal 7 to Drupal 10 and then updated to Drupal 11. The forum module in Drupal 7 did not seem to be in use, it was listed as not installed. I have not intended to migrate any of the forum content from Drupal 7. I have uninstalled and reinstalled the forum module in Drupal 10 (core module) and again in Drupal 11 (contributed module).

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Not sure why I marked this RTBC πŸ˜„

    I think we're kind of at the point now where we might need to jump on a call to work out why you're not getting data in the forum/forum_index tables. Will send you an email with some possible times.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    Here's the logic of how things should work:

    • /forum and /forum/{tid} are built by taking the taxonomy ID and querying the forum_index table to find records
    • the forum_index table is written to from node hooks as follows:
      • forum_node_presave runs and sets the forum_id property on the node based on the value in the taxonomy_forums field
      • forum_node_update or forum_node_insert run depending on whether the node is new or not. Both of these start by checking that the node has a field named taxonomy_forums and then if forum_tid is set call the forum index storage server to keep the records in both the forum and forum_index tables up to date

    If you have access to a debugger, you may be able to step through this and see where it is failing.

  • πŸ‡¦πŸ‡ΊAustralia larowlan πŸ‡¦πŸ‡ΊπŸ.au GMT+10

    One thing that might be an issue here is that your field-map might be corrupt - which would cause the 'does the taxonomy_forums' field exist on the forum node type to fail.

    You could check that with drush if you have it

    drush php-eval "echo (\array_key_exists('taxonomy_forums', \Drupal::service('entity_field.manager')->getFieldDefinitions('node', 'forum')) ? 'Field exists in field map' : 'No forums field in field map') . \PHP_EOL;"
    
  • Thanks, that helps.
    The result of the drush command was that the field exists.

Production build 0.71.5 2024