- 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_presaveruns and sets theforum_idproperty on the node based on the value in thetaxonomy_forumsfieldforum_node_updateorforum_node_insertrun depending on whether the node is new or not. Both of these start by checking that the node has a field namedtaxonomy_forumsand then ifforum_tidis set call the forum index storage server to keep the records in both theforumandforum_indextables 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.