- π³πΏNew Zealand quietone
I think the source of the problem is that the taxonomy source plugins do not exclude forum. Moving code related to the process plugins, as suggested in #13, and isn't going to change that.
- π³πΏNew Zealand quietone
To see what this looks like here is a patch that removes the forum processes from the taxonomy migrations and adds them back in hooks. There are updates to the forum fixtures, so I have made a patch without that to make it easier to review. And I did not look at the Functional tests, so I expect failure.
- Status changed to Needs review
almost 2 years ago 6:05am 27 March 2023 - π³πΏNew Zealand quietone
Most failures due to errors in
forum_migration_plugins_alter
.The error in \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateForumTest is fixed in π Change MigrateForumTest to use forum test fixture Fixed .
- π³πΏNew Zealand quietone
The test MigrateLanguageContentTaxonomyVocabularySettingsTest.php isn't right. There should be one in forum that tests for the changed name.
The last submitted patch, 17: 2914251-17.patch, failed testing. View results β
The last submitted patch, 18: 2914251-18.patch, failed testing. View results β
- π³πΏNew Zealand quietone
I thought I ran those failing tests locally but I ran the ones in migrate_drupal_ui out of habit and not the ones in forum. The updates the Upgrade tests for the changes to the source fixtures. I also sorted the entity count array which make is appear that more counts were changed. I did that because it is just a pain that the lists never got sorted.
This should results in 1 failing test, \Drupal\Tests\forum\Kernel\Migrate\d6\MigrateForumTest which is fixed elsewhere.
The last submitted patch, 21: 2914251-21.patch, failed testing. View results β
- Status changed to Active
almost 2 years ago 11:57pm 29 March 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
π₯ this is amazing! Looks like just that one fail (one is random)
-
+++ b/core/modules/forum/forum.module @@ -643,3 +654,95 @@ function template_preprocess_forum_submitted(&$variables) { + $forum_container_tids = unserialize($result[0]); ... + $forum_nav_vocabulary = unserialize($result[0]);
paranoia but let's add the ['allowed_classes' => FALSE] as the second argument here
-
+++ b/core/modules/forum/forum.module @@ -643,3 +654,95 @@ function template_preprocess_forum_submitted(&$variables) { +function merge_forum_vocabulary($process) {
this is only used inside the alter hook, so let's make it a closure inside that function instead
-
+++ b/core/modules/forum/tests/src/Kernel/Migrate/d6/MigrateTaxonomyTermTest.php @@ -0,0 +1,134 @@ + $this->assertEquals($expected_parents, $this->getParentIDs($id));
this could use
array_column($entity->get('parent')->getValue(), 'target_id')
and save the need for the protected method as well as a few extra queries
-
- Assigned to quietone
- π³πΏNew Zealand quietone
If I don't update this by Monday, feel free to set to 'unassigned'.
- Status changed to Needs review
almost 2 years ago 10:04am 30 March 2023 - π³πΏNew Zealand quietone
This patch address all the items in #23. There were no issues, it was all straightforward.
The last submitted patch, 25: 2914251-25.patch, failed testing. View results β
- last update
over 1 year ago 29,558 pass, 10 fail - π³πΏNew Zealand quietone
Rerolled. Also, the incremental migrations are not run in the functional test so the method returns an empty array instead of entity counts.
The last submitted patch, 28: 2914251-28.patch, failed testing. View results β
- last update
over 1 year ago 29,561 pass, 4 fail - π³πΏNew Zealand quietone
Adding a test file to the d6 and d7 Functional tests.
The last submitted patch, 30: 2914251-30.patch, failed testing. View results β
25:48 23:15 Running- π³πΏNew Zealand quietone
This will fix one of the tests. It needed checks forum_migrate_prepare_row and forum_migrate_d7_taxonomy_vocabulary_prepare_row that the results from a query exist before trying to use them. And a change to \Drupal\Tests\forum\Functional\migrate_drupal\d6\Upgrade6Test::getEntityCountsIncremental to return an empty array because we are not testing incremental migrations here. Also re-installed Upload in the d6 database.
The last submitted patch, 32: 2914251-32.patch, failed testing. View results β
- last update
over 1 year ago 29,559 pass, 5 fail - π³πΏNew Zealand quietone
It too a long time but I finally spotted the problem. In
forum_migration_plugins_alter
I have the machine name as 'forum' instead of 'taxonomy_forum'. With that fixed all the remained was to correct the tests. The last submitted patch, 34: 2914251-34.patch, failed testing. View results β
- last update
over 1 year ago Patch Failed to Apply - π³πΏNew Zealand quietone
Ignore #34.
While investigating the error in #32 I saw that forum is being installed in two Migration tests in the taxonomy module. This should fix both of those and move what needs to move to forum tests. I also made MigrateTestTrait in forum to make the tests a bit easier to follow.
- last update
over 1 year ago 29,563 pass, 1 fail The last submitted patch, 37: 2914251-37.patch, failed testing. View results β
39:11 31:43 Running- π³πΏNew Zealand quietone
Now to fix the error in MigrateForumTest. It seems that I did not complete
forum_migration_plugins_alter
and didn't have the correct process for the field name, that have been removed from the taxonomy migrations. With that fixed some tests needed to use the correct field name. - Issue was unassigned.
- Status changed to RTBC
over 1 year ago 5:39am 27 June 2023 - π¦πΊAustralia larowlan π¦πΊπ.au GMT+10
I went through each of the tests here that extend from core tests (other than base classes) and made sure we've named the test method the same and that the parent classes don't contain any other test methods (so we're not inadvertently running the same identical test twice).
All of them looked good.
The changes since #23 look good to me.
This was a huge effort @quietone and my comment 'just one fail' was famous last words.
Thanks for all your efforts here!
- last update
over 1 year ago 29,573 pass - last update
over 1 year ago 29,581 pass - last update
over 1 year ago 29,581 pass - last update
over 1 year ago 29,811 pass - last update
over 1 year ago 29,812 pass - last update
over 1 year ago 29,812 pass - last update
over 1 year ago 29,817 pass - last update
over 1 year ago 29,821 pass - last update
over 1 year ago 29,825 pass - last update
over 1 year ago 29,825 pass - last update
over 1 year ago 29,832 pass - last update
over 1 year ago 29,849 pass - last update
over 1 year ago 29,888 pass - last update
over 1 year ago 29,891 pass - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - last update
over 1 year ago Patch Failed to Apply - Status changed to Needs review
over 1 year ago 9:46am 9 August 2023 - last update
over 1 year ago 29,968 pass, 1 fail - π³πΏNew Zealand quietone
This needed a reroll. I also sorted the list of entity types in the forum tests, Upgrad6Test and Upgrade7Test
The last submitted patch, 42: 2914251-42.patch, failed testing. View results β
- last update
over 1 year ago 29,968 pass - π³πΏNew Zealand quietone
Ignore #42. I wasn't working from a clean site.
- Status changed to RTBC
over 1 year ago 5:52pm 9 August 2023 - πΊπΈUnited States smustgrave
Since this was previously RTBC and reroll #44 seems good going to remark.
- last update
over 1 year ago 29,968 pass - last update
over 1 year ago 29,968 pass - last update
over 1 year ago 29,969 pass - last update
over 1 year ago 29,987 pass - last update
over 1 year ago 30,059 pass - last update
over 1 year ago 30,066 pass - last update
over 1 year ago 30,066 pass - last update
over 1 year ago 30,070 pass - last update
over 1 year ago 30,070 pass - last update
over 1 year ago 30,073 pass - last update
over 1 year ago 30,144 pass - last update
over 1 year ago 30,145 pass - last update
over 1 year ago 30,146 pass - last update
over 1 year ago 30,146 pass - Status changed to Fixed
over 1 year ago 9:16pm 7 September 2023 - π¬π§United Kingdom catch
Looks great and how it should have been done all along as evidenced by the age of the issue.
Committed/pushed to 11.x, thanks!
- Status changed to Needs work
over 1 year ago 12:46am 18 September 2023 - π³πΏNew Zealand quietone
This needs a change record and then a followup to correct the URL in the deprecation messages. I am working on this now.
- Status changed to Fixed
over 1 year ago 1:11am 18 September 2023 - π³πΏNew Zealand quietone
Change record made and published. The followup is π Fix change record link added in #2914251 Active
Automatically closed - issue fixed for 2 weeks with no activity.
- Status changed to Fixed
12 months ago 1:27am 22 January 2024 - π©πͺGermany donquixote
if (is_a($source_plugin, D7Vocabulary::class) && !is_a($source_plugin, D7VocabularyTranslation::class) && !is_a($source_plugin, D7LanguageContentSettingsTaxonomyVocabulary::class)) { if (isset($migration['process']['vid'])) { $process[] = $migrations[$migration_id]['process']['vid']; $migrations[$migration_id]['process']['vid'] = $merge_forum_vocabulary($process); } }
This code can lead to problems.
In core 'd7_taxonomy_vocabulary',
$migrations[$migration_id]['process']['vid']
is a single process plugin, so all is good.But with a custom migration, as with migrate_plus,
$migrations[$migration_id]['process']['vid']
is already an array of process plugins. The$process[] = ..
assignment will result in a nesting level that is one level too deep.As a result, I get "Undefined array key "plugin" Migration.php:727" for the upgrade_d7_taxonomy_vocabulary migration.
In fact, the upgrade_d7_taxonomy_vocabulary generated with migrate_plus contains has the 'forum_vocabulary' processor in 'vid'.
So adding it again would result in duplication.As a workaround, I can edit the custom migration, by copying the 'vid' process setup from 'd7_taxonomy_vocabulary'.
Still, this should be fixed.