Updated: Comment #0

Problem/Motivation

Forum module creates the forum vocabulary in code, but as each install would have a different UUID this will lead to content staging issues.

Proposed resolution

vid: forums
uuid: c1341fb5-045a-4af4-9b06-6db165364a5f
name: Forums
description: 'Forum navigation vocabulary'
hierarchy: 1
weight: -10
status: true
langcode: en

Remaining tasks

Patch
Test

User interface changes

None

API changes

None

Follow-up from #1951268: Convert /forum and /forum/% to new router, remove forum_forum_load(), forum_get_topics(), create Forum service.
[2032699]

Files: 
CommentFileSizeAuthor
#9 drupal8.forum-module.2077435-9.patch2.89 KBandypost
PASSED: [[SimpleTest]]: [MySQL] 58,832 pass(es).
[ View ]
#1 yml-vocab-2077435.patch472 byteslarowlan
FAILED: [[SimpleTest]]: [MySQL] 57,222 pass(es), 40 fail(s), and 11 exception(s).
[ View ]

Comments

Assigned:larowlan» Unassigned
Status:Active» Needs review
StatusFileSize
new472 bytes
FAILED: [[SimpleTest]]: [MySQL] 57,222 pass(es), 40 fail(s), and 11 exception(s).
[ View ]

Status:Needs review» Needs work

The last submitted patch, yml-vocab-2077435.patch, failed testing.

Fails are because we need the field_info_cache_clear() from #1951268: Convert /forum and /forum/% to new router, remove forum_forum_load(), forum_get_topics(), create Forum service in forum_modules_enabled(), recognize that list anywhere.

Suppose containers should be created the same way, also related #2032699: Preserve taxonomy_forums field when uninstalling forum module

Status:Needs work» Needs review

#1: yml-vocab-2077435.patch queued for re-testing.

Container field is created with yml

Status:Needs review» Needs work

The last submitted patch, yml-vocab-2077435.patch, failed testing.

Status:Needs work» Needs review
StatusFileSize
new2.89 KB
PASSED: [[SimpleTest]]: [MySQL] 58,832 pass(es).
[ View ]

Also removed code that creates vocabulary

Also I found that vocabulary is not deleted after uninstall and once forum module installed again the 'General discussion' forum is duplicated, so #2032699: Preserve taxonomy_forums field when uninstalling forum module needs land first or issues needs to be merged

thanks I was also working on this and added the following:

<?php
$term_storage_controller
= \Drupal::entityManager()->getStorageController('taxonomy_term');
  if (!
$term_storage_controller->loadByProperties(array(
   
'name' => t('General discussion')
  ))) {
 
// ... Create the term here ...
}
?>

Do you think that's worth adding here?

I think we should decide how install/uninstall should work, seems config entities from other modules are not deleted when module uninstalled (node type, vocabulary, fields, displays)
Now we have no disabled state so all code comments about disabled taxonomy and comment should be removed as well
1) do the forum need to delete own content and config - then we need to re-factor hook_uninstall()
2) no (supposed) then hook_install() needs some turning to find existing content

PS: 'General discussion' could be renamed so searching the term is fragile

Status:Needs review» Reviewed & tested by the community

Lets not beat around the bush.
#2106243: Use yml files to create the forum module's comment and taxonomy term fields pushes the cleanup of forum_install() further and is blocked on this.
If you uninstall forum and then reinstall it you will end up with two General Discussion terms, I don't see an issue in that. Its not a regular use case.

Status:Reviewed & tested by the community» Fixed

Wow, this cleans up a surprising amount of totally ugly code!

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.

Issue summary:View changes

Updated issue summary.