Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
function forum_update_8000() {
$map = db_query('SELECT vid, machine_name FROM {taxonomy_vocabulary}')->fetchAllKeyed();
$forum_vid = update_variable_get('forum_nav_vocabulary', FALSE);
if (!empty($map[$forum_vid])) {
// Update the variable to reference the machine name instead of the vid.
update_variable_set('forum_nav_vocabulary', $map[$forum_vid]);
}
update_variables_to_config('forum.settings', array(
'forum_hot_topic' => 'topics.hot_threshold',
'forum_per_page' => 'topics.page_limit',
'forum_order' => 'topics.order',
'forum_nav_vocabulary' => 'vocabulary',
'forum_block_num_active' => 'block.active.limit',
'forum_block_num_new' => 'block.new.limit',
));
}
See parent issue #2181257: [meta] Variables to config migration [d7] for instructions.
Comment | File | Size | Author |
---|---|---|---|
#16 | 2353703-16.patch | 4 KB | quietone |
#9 | interdiff-2353703-7-9.txt | 1.7 KB | quietone |
#9 | 2353703-9.patch | 4 KB | quietone |
#7 | 2353703-7.patch | 4.19 KB | quietone |
#5 | 2353703-5.patch | 4.55 KB | phenaproxima |
|
Comments
Comment #1
miguelc303 CreditAttribution: miguelc303 commentedI did a patch to enable end users to migrate Forum Settings Configuration from Drupal 7 to Drupal 8.
Test(s) (and maybe a dump file) still need to be written.
Comment #2
miguelc303 CreditAttribution: miguelc303 at Anexus commentedAdded organization support to Anexus IT
Comment #3
jcost CreditAttribution: jcost commentedWill need to be submitted again to Core since moving from sandbox.
Comment #4
phenaproximaNeeds to be merged with the parent issue.
Comment #5
phenaproximaUpdated for HEAD and wrote a test. But...because this migration depends on d7_taxonomy_vocabulary, it is flat-out blocked by #2410875: Migration for Drupal 7 Taxonomy vocabularies and terms.
Comment #6
phenaproximaUnblocked!
Comment #7
quietone CreditAttribution: quietone commentedReroll
Comment #8
phenaproximaA few things jump out at me, but otherwise this is good to go.
Per @alexpott, config dependencies are not allowed in migration templates, so all this needs to be removed.
Let's not do this prepareMigrations() stuff -- just run the dependent migration directly (as well as any dependencies it has) using executeMigration().
Can this be renamed to testForumSettingsMigration()?
Comment #9
quietone CreditAttribution: quietone commented1-3 Fixed.
Comment #10
quietone CreditAttribution: quietone commentedComment #15
phenaproximaThis pleases my eyes and my brain. And DrupalCI. RTBC!
Comment #16
quietone CreditAttribution: quietone commentedReroll
Comment #17
mikeryanYep, just rerolled Variable.php, restoring RTBC.
Comment #18
webchickCommitted and pushed to 8.0.x. Thanks!