- Issue created by @andypost
- Status changed to Needs review
over 1 year ago 2:54pm 18 March 2023 - 🇫🇷France andypost
re-parented to 🌱 [META] Provide modern replacements for and deprecate the legacy include files Active
- Status changed to RTBC
over 1 year ago 11:14pm 18 March 2023 - 🇳🇱Netherlands daffie
All code changes look good to me.
Deprecation message testing has been added.
The testbot return green.
The IS and the CR are in order.
For me it is RTBC. - 🇦🇺Australia purencool
The result of testing patch 3348848-3.patch.
Branch
git branch 10.0.x * 10.1.x
Searching references of the theme_get_registry function being called before applying the patch.
git grep theme_get_registry core/includes/theme.inc:function theme_get_registry($complete = TRUE) { core/lib/Drupal/Core/Render/theme.api.php: $hooks = theme_get_registry();
When administering the patch the following error occurred. The issue is likely the testLegacyThemeRegistryRebuild() method was added to core.
git apply --index 3348848-3.patch error: patch failed: core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php:256 error: core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php: patch does not apply
@@ -256,4 +256,18 @@ public function testThemeTemplatesRegisteredByModules() { $this->assertEquals($expected, array_values($registry['theme_test_registered_by_module']['preprocess functions'])); }
Using @andypost's original code a refactored patch was created and has been added to the ticket.
www-data@5e92f19c6122:/app/build/core$ ../vendor/bin/phpunit --filter=testLegacyThemeGetRegistry ../core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php PHPUnit 9.6.5 by Sebastian Bergmann and contributors. Testing Drupal\KernelTests\Core\Theme\RegistryTest . 1 / 1 (100%) Time: 00:01.550, Memory: 8.00 MB OK (1 test, 4 assertions)
After the newly created patch the theme_get_registry function seems to be no longer called.
www-data@5e92f19c6122:/app/build$ git grep theme_get_registry core/includes/theme.inc:function theme_get_registry($complete = TRUE) { core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php: * Tests deprecated theme_get_registry function. core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php: * @see theme_get_registry() core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php: $this->expectDeprecation('theme_get_registry() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use theme.registry service method get() instead. See https://www.drupal.org/node/3348850'); core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php: $this->assertEquals($registry->get(), theme_get_registry()); core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php: $this->expectDeprecation('theme_get_registry() is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. Use theme.registry service method getRuntime() instead. See https://www.drupal.org/node/3348850'); core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php: $this->assertEquals($registry->getRuntime(), theme_get_registry(FALSE));
- Status changed to Fixed
over 1 year ago 7:43am 28 March 2023 Automatically closed - issue fixed for 2 weeks with no activity.