- 🇺🇸United States dcam
When the module is tested on PHP 8.1 the 7.x-1.x migration starts causing one of those cryptic "Uncaught AssertionError: The container was serialized." errors. Since this patch eliminates that migration, I decided to review it finally.
-
+++ b/modules/ingredient/ingredient.module @@ -137,3 +144,80 @@ function ingredient_quantity_from_fraction($ingredient_quantity) { + $node_source_plugin = NULL; + try { + $node_source_plugin = MigrationDeriverTrait::getSourcePlugin('d7_node'); + } + catch (PluginNotFoundException $e) { + } + catch (RequirementsException $e) { + } + + if (!$node_source_plugin) { + return; + } +
Using a trait outside the scope of a class is deprecated. So I'm copying the code from that trait into the
try
block. I think we can also simplify the logic here and just return if any exception is thrown. -
+++ b/modules/ingredient/ingredient.module @@ -137,3 +144,80 @@ function ingredient_quantity_from_fraction($ingredient_quantity) { + $migrations[$plugin_id]['migration_tags'][] = 'Recipe node';
I'm slightly concerned about naming collisions here, so I'm making the tag name more specific. It probably doesn't matter at all, but it also won't hurt to tweak it.
-
+++ b/modules/ingredient/tests/src/Kernel/Migrate/recipe71/MigrateIngredient71Test.php @@ -16,7 +16,7 @@ class MigrateIngredient71Test extends MigrateIngredient71TestBase { - protected static $modules = ['ingredient']; + protected static $modules = ['ingredient', 'node'];
I don't understand the reason for this change.
-
+++ b/modules/ingredient/tests/src/Kernel/Migrate/recipe71/MigrateIngredientSettings71Test.php @@ -12,7 +12,7 @@ class MigrateIngredientSettings71Test extends MigrateIngredient71TestBase { - protected static $modules = ['ingredient']; + protected static $modules = ['ingredient', 'node', 'text']; +++ b/tests/src/Kernel/Migrate/recipe71/MigrateRecipe71Test.php @@ -16,6 +16,7 @@ class MigrateRecipe71Test extends MigrateRecipe71TestBase { + 'comment',
Or this change.
-
+++ b/tests/src/Kernel/Migrate/recipe71/MigrateRecipeDisplaySettings71Test.php @@ -24,6 +31,7 @@ class MigrateRecipeDisplaySettings71Test extends MigrateRecipe71TestBase { + $this->installSchema('node', 'node_access');
Or this change and the corresponding addition of the node_access table to the fixture.
- And I think there might be one other that Dreditor didn't copy in properly.
Removing those changes didn't cause the tests to fail locally, so I'm taking them out of the patch.
-
- 🇺🇸United States dcam
I missed removing an additional fixture change for the node_access table.
- Status changed to Fixed
almost 2 years ago 6:36pm 18 February 2023 Automatically closed - issue fixed for 2 weeks with no activity.