Problem/Motivation

Check all migrations referring to forum to see what needs to be done. There are 19.

$ ag -l forum core/modules/*/migrations | grep -v modules/forum | wc -l
19
  1. The text 'forum' appears in a static_map process plugin in the following migrations.
    • core/modules/block/migrations/d6_block.yml
    • core/modules/block/migrations/d7_block.yml
    • core/modules/comment/migrations/d6_comment_type.yml
    • core/modules/comment/migrations/d7_comment_type.yml
    • core/modules/config_translation/migrations/d6_block_translation.yml
    • core/modules/config_translation/migrations/d7_block_translation.yml
    • core/modules/config_translation/migrations/d7_field_instance_option_translation.yml
    • core/modules/content_translation/migrations/d6_language_content_comment_settings.yml
    • core/modules/field/migrations/d7_field_instance.yml
    • core/modules/user/migrations/d6_user_role.yml
    • core/modules/user/migrations/d7_user_role.yml
  2. The following use this process forum_container: is_container.
    • core/modules/content_translation/migrations/d7_taxonomy_term_entity_translation.yml
    • core/modules/taxonomy/migrations/d7_taxonomy_term.yml
  3. The following use the process plugin forum_vocabulary.
    • core/modules/taxonomy/migrations/d6_taxonomy_vocabulary.yml
    • core/modules/taxonomy/migrations/d6_vocabulary_entity_display.yml
    • core/modules/taxonomy/migrations/d6_vocabulary_entity_form_display.yml
    • core/modules/taxonomy/migrations/d6_vocabulary_field_instance.yml
    • core/modules/taxonomy/migrations/d6_vocabulary_field.yml
    • core/modules/taxonomy/migrations/d7_taxonomy_vocabulary.yml

Proposed resolution

1. No change to usages of 'forum' in static_map process plugins
2. Remove forum_vocabulary from taxonomy module and add back in hooks when forum is enabled
3, Remove forum_container and is_container from taxonomy module and add back in hooks when forum is enabled

Items 2 and 3 are being implemented in #2914251: Move forum related logic from taxonomy migrations to new forum migrations.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Comments

quietone created an issue. See original summary.

quietone’s picture

Issue summary: View changes

The static map and the simple assigned are ok as it. The process plugin forum_vocabulary uses a flag set in the source plugin to identify the vocabulary as a forum one, in that case the vid if the row is for a forum. Again, there is nothing there that requires the forum module.

There is no need to change or move any of these migrations that refer to forum. None of these require forum data to exist, or the forum module to be enabled.

quietone’s picture

Status: Active » Needs review
Manoj Raj.R’s picture

Manoj Raj.R’s picture

@quietone
What is the importance of this issue.
what is the proposed solution. Is it impacting on 10

quietone’s picture

@Manoj Raj.R, this is one of the steps to deprecate the Forum module. There is more detail about that process in the parent issue, That issue also has a link to the issue where the deprecation and removal of the Forum module was approved.

I made this issue so that there was a place to discuss what happens to migrations that do anything regarding the Forum module. As for the proposed resolution, it is as stated in the Issue Summary. That is, I don't think anything needs to be done regarding the migrations listed in the Issue Summary. Therefore, nothing changes for Drupal 10 because of this issue.

Manoj Raj.R’s picture

Ok!

larowlan’s picture

@quietone for the static map ones, do we have the option of filtering out those rows in the source, and then duplicating those migrations to the forum module and doing the converse (filtering to only the forum rows)

smustgrave’s picture

Aren't these files being moved to migrate_drupal to also be deprecated/removed?

quietone’s picture

Re #8. There was some discussion about this, specifically about block migrations. #3265483: Handle block migration for modules moved to contrib and #3267309: Decide whether to completely skip the migration of blocks from missing modules. In that case it was preferred to leave the migrations as is because it would allow the migrator to get an error that something was not migrated. This still needs more disucssion.

#9. Yes, that is true. However, Forum is moving to contrib so we should complete this first. That will likely happen anyway because deprecating migrate_drupal is a much bigger task.

larowlan’s picture

Should this be Needs Review, no patch/MR that I can see?

benjifisher’s picture

@larowlan:

Would it make more sense if we changed the title to "Evaluate migrations ..." or "[Policy, no patch] Handle migrations ..."?


There is nothing wrong with migration code that supports contrib modules, so +1 for keeping the migrations as is unless they actually cause problems.

My favorite example of support in core for contrib modules is the filter_id process plugin in the filter module.

Most of the migrations that refer to "forum" set some property using the static_map process plugin, and one or more of the keys that get mapped are related to the Forum module. This is harmless, so leave it as is.

Maybe I am going outside the scope of this issue, but I support moving everything related to the forum_vocabulary process plugin into the Forum module. Maybe leave the parts that are in the migrate_drupal module where they are; everything else is in the taxonomy module. Here is what that would involve:

  1. Move the process plugin from Taxonomy to Forum.
  2. Set the forum_vocabulary source property somewhere other than the d6_taxonomy_vocabulary and d7_taxonomy_vocabulary source plugins. I am not sure what the best way is, but we must have an event or an alter hook that lets us modify a row.
  3. Implement hook_migration_plugins_alter() to insert the process plugin into 6 migrations, and remove the corresponding step from those migrations.

I am not sure it is worth the effort, but it would have the effect of simplifying the code that is left behind when we remove the Forum module.

Similar: the code related to the is_container source property (set in the d7_taxonomy_term and d7_taxonomy_term_entity_translation source plugins) and the forum_container taxonomy field (boolean?) should be moved to the Forum module, if someone is willing to make the effort. Curiously, there is some test code related to this field, but I do not see any tests that mention forum_vocabulary.

benjifisher’s picture

I just noticed the related issue #2914251: Move forum related logic from taxonomy migrations to new forum migrations. Perhaps we can make that issue a sibling of this one (child of the same meta issue) and use that issue to make the changes I suggested in #13.

smustgrave’s picture

Is this more a plan then a task?

quietone’s picture

Title: Handle migrations for deprecating forum » [Meta] Handle migrations for deprecating forum
Category: Task » Plan
Related issues: -#2914251: Move forum related logic from taxonomy migrations to new forum migrations

I agree with #14, I am updating the meta data.

quietone’s picture

Issue summary: View changes

I misread #14 but am leaving the changes for now. Updated the IS with the current proposal

benjifisher’s picture

Issue summary: View changes

I think something got lost in #17. Is this what you meant? (See 2 and3 in the proposed resolution.)

quietone’s picture

Title: [Meta] Handle migrations for deprecating forum » [Meta] Handle forum migrations not in the forum module for deprecating forum
Issue summary: View changes

@benjifisher, I was trying to refer to your suggestion of making this issue a sibling of #2914251: Move forum related logic from taxonomy migrations to new forum migrations. Instead I made this the parent of that one. I was thinking that here we could discuss the approach and record the decision in this one issue. Any implementations of those decisions are then children of this issue. For me, I prefer one issue on #3267261: [Meta] Tasks to deprecate Forum to represent this body of work.

I updated the IS to show that 2 and 3 of the proposed resolution are being explored in #2914251: Move forum related logic from taxonomy migrations to new forum migrations.

larowlan’s picture

Status: Needs review » Active

Version: 10.1.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, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

quietone’s picture

Status: Active » Reviewed & tested by the community

I reviewed the child issue and it does resolve the points in the issue summary. I think this is now fixed.

I will set to RTBC for others to check.

catch’s picture

This is still in d7/TermTest:

  $tests[0]['source_data']['variable'] = [
      [
        'name' => 'forum_containers',
        'value' => 'a:3:{i:0;s:1:"5";i:1;s:1:"6";i:2;s:1:"7";}',
      ],

I guess that is fine because it's just test data?

Otherwise looks like no traces left.

larowlan’s picture

Status: Reviewed & tested by the community » Fixed

Yeah, I agree this can be marked done.

There's a reference to forum_containers in the variables table but on it's own that does nothing.

There's also some terms from a 'forum' vocabulary that are migrated but they're migrated as terms - because that's what they are.

There's no special handling for the fact the vocab is called forum in the taxonomy module.

Status: Fixed » Closed (fixed)

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