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]

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

larowlan’s picture

Assigned: larowlan » Unassigned
Status: Active » Needs review
FileSize
472 bytes

Status: Needs review » Needs work

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

larowlan’s picture

larowlan’s picture

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.

andypost’s picture

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

larowlan’s picture

Status: Needs work » Needs review

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

larowlan’s picture

Container field is created with yml

Status: Needs review » Needs work

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

andypost’s picture

Status: Needs work » Needs review
FileSize
2.89 KB

Also removed code that creates vocabulary

andypost’s picture

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

larowlan’s picture

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

$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?

larowlan’s picture

andypost’s picture

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

larowlan’s picture

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.

andypost’s picture

webchick’s picture

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.

Anonymous’s picture

Issue summary: View changes

Updated issue summary.