The last submitted patch, 79: 2926070-79.patch, failed testing. View results โ
- Status changed to RTBC
over 1 year ago 1:40pm 4 April 2023 - ๐บ๐ธUnited States smustgrave
Applied patch #81
Searched for "Drupal::service('module_handler')->getName" only instance I found was in the test.
Change record appears to list those classes that have been updated with a new argument.
Think this is good.
- Status changed to Needs work
over 1 year ago 4:10pm 4 April 2023 - ๐ฌ๐งUnited Kingdom alexpott ๐ช๐บ๐
-
+++ b/core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php @@ -46,13 +48,13 @@ protected function processDefinitionCategory(&$definition) { - $list = $this->getModuleHandler()->getModuleList(); - // If the module exists, return its human-readable name. - if (isset($list[$provider])) { - return $this->getModuleHandler()->getName($provider); + try { + return $this->getModuleExtensionList()->getName($provider); + } + catch (UnknownExtensionException $e) { + // Otherwise, return the machine name. + return $provider; } - // Otherwise, return the machine name. - return $provider;
With these changes \Drupal\Core\Plugin\CategorizingPluginManagerTrait::getModuleHandler is unused so we should deprecate it.
-
+++ b/core/lib/Drupal/Core/Plugin/CategorizingPluginManagerTrait.php @@ -70,6 +72,21 @@ public function getModuleHandler() { + /** + * Returns the module extension list used. + * + * @return \Drupal\Core\Extension\ModuleExtensionList + * The module extension list. + */ + public function getModuleExtensionList(): ModuleExtensionList {
Why public? I think the old getModuleHandler() was public by mistake. This doesn't feel like it should be a public method of a plugin manager.
-
+++ b/core/modules/language/language.module --- a/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php @@ -76,11 +77,17 @@ class ReviewForm extends MigrateUpgradeFormBase { - public function __construct(StateInterface $state, MigrationPluginManagerInterface $migration_plugin_manager, PrivateTempStoreFactory $tempstore_private, MigrationState $migrationState, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler) { + public function __construct(StateInterface $state, MigrationPluginManagerInterface $migration_plugin_manager, PrivateTempStoreFactory $tempstore_private, MigrationState $migrationState, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, protected ?ModuleExtensionList $moduleExtensionList = NULL) { parent::__construct($config_factory, $migration_plugin_manager, $state, $tempstore_private); $this->migrationState = $migrationState; $this->moduleHandler = $module_handler; + if ($this->moduleExtensionList === NULL) { + @trigger_error('Calling ' . __METHOD__ . '() without the $moduleExtensionList argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3310017', E_USER_DEPRECATED); + $this->moduleExtensionList = \Drupal::service('extension.list.module'); + }
The module handler can be deprecated here - use a union id
ModuleHandlerInterface|ModuleExtensionList $module_handler
and theDeprecatedServicePropertyTrait
. This is better than doing constructor promotion because it means less change in the future. It does mean you'll have to add the typehinted property the ModuleExtensionList but it means we don't have a NULL argument and we don't have to go about removing the module handler later. -
+++ b/core/modules/user/src/Plugin/views/access/Permission.php @@ -57,11 +58,17 @@ class Permission extends AccessPluginBase implements CacheableDependencyInterfac + * @param \Drupal\Core\Extension\ModuleExtensionList|null $moduleExtensionList + * The module extension list. */ - public function __construct(array $configuration, $plugin_id, $plugin_definition, PermissionHandlerInterface $permission_handler, ModuleHandlerInterface $module_handler) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, PermissionHandlerInterface $permission_handler, ModuleHandlerInterface $module_handler, protected ?ModuleExtensionList $moduleExtensionList = NULL) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->permissionHandler = $permission_handler; $this->moduleHandler = $module_handler;
We need to deprecate passing in module handler here. We can use a union on the last argument to pass in either a module handler or a module extension list and do the right thing. We can also use the deprecatedServicePropertyTrait to provide BC.
-
+++ b/core/modules/user/src/Plugin/views/field/UserData.php --- a/core/modules/user/src/Plugin/views/filter/Permissions.php +++ b/core/modules/user/src/Plugin/views/filter/Permissions.php +++ b/core/modules/user/src/Plugin/views/filter/Permissions.php @@ -44,12 +45,18 @@ class Permissions extends ManyToOne { - public function __construct(array $configuration, $plugin_id, $plugin_definition, PermissionHandlerInterface $permission_handler, ModuleHandlerInterface $module_handler) { + public function __construct(array $configuration, $plugin_id, $plugin_definition, PermissionHandlerInterface $permission_handler, ModuleHandlerInterface $module_handler, protected ?ModuleExtensionList $moduleExtensionList = NULL) { parent::__construct($configuration, $plugin_id, $plugin_definition); $this->permissionHandler = $permission_handler; $this->moduleHandler = $module_handler; + if ($this->moduleExtensionList === NULL) { + @trigger_error('Calling ' . __METHOD__ . '() without the $moduleExtensionList argument is deprecated in drupal:10.1.0 and will be required in drupal:11.0.0. See https://www.drupal.org/node/3310017', E_USER_DEPRECATED); + $this->moduleExtensionList = \Drupal::service('extension.list.module'); + }
Module handler is not longer used... we can use a union and to the same as above here.
-
- Status changed to Needs review
over 1 year ago 7:03pm 2 May 2023 - last update
over 1 year ago 29,372 pass - ๐ซ๐ทFrance andypost
I think better to parent the issue to ๐ ModuleHandler should not maintain list of installed modules now that ModuleExtensionList exists Needs work according to #42
needs summary update for newAPI changes at least
- last update
over 1 year ago 29,372 pass - last update
over 1 year ago 29,372 pass - last update
over 1 year ago 29,371 pass, 2 fail - ๐ซ๐ทFrance andypost
And re-roll for 10.2 as beta phase + minor clean-up
The last submitted patch, 85: 2926070-85.patch, failed testing. View results โ
- last update
over 1 year ago 29,372 pass - last update
over 1 year ago 29,372 pass - Status changed to Needs work
over 1 year ago 6:52pm 6 May 2023 - ๐บ๐ธUnited States smustgrave
Can't believe we are already in 10.2.
Any idea when a 10.2.x-dev will be opened? This ticket should probably be postponed on that.
But the deprecation looks good.
Moving to NW for the issue summary update you tagged in #84.
- Status changed to Needs review
over 1 year ago 12:53am 8 May 2023 - ๐ฆ๐บAustralia kim.pepper ๐โโ๏ธ๐ฆ๐บSydney, Australia
Updated IS.
- Status changed to RTBC
over 1 year ago 10:19pm 8 May 2023 - last update
over 1 year ago 29,381 pass - last update
over 1 year ago 29,384 pass - last update
over 1 year ago 29,389 pass - Open on Drupal.org โEnvironment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago 29,388 pass, 2 fail The last submitted patch, 85: 2926070-85.patch, failed testing. View results โ
- last update
over 1 year ago 29,389 pass - last update
over 1 year ago 29,389 pass - Open on Drupal.org โEnvironment: PHP 8.1 & MySQL 5.7last update
over 1 year ago Waiting for branch to pass - last update
over 1 year ago 29,396 pass - last update
over 1 year ago 29,400 pass - last update
over 1 year ago 29,400 pass - last update
over 1 year ago 29,401 pass - last update
over 1 year ago 29,410 pass - last update
over 1 year ago 29,410 pass - last update
over 1 year ago 29,416 pass - last update
over 1 year ago 29,421 pass - last update
over 1 year ago 29,421 pass - last update
over 1 year ago 29,426 pass - last update
over 1 year ago 29,430 pass - Status changed to Needs work
over 1 year ago 2:36am 16 June 2023 - ๐ฆ๐บAustralia kim.pepper ๐โโ๏ธ๐ฆ๐บSydney, Australia
Needs a rebase on 11.x
- Status changed to Needs review
over 1 year ago 7:04am 16 June 2023 - last update
over 1 year ago 29,474 pass - ๐ซ๐ทFrance andypost
re-roll after context change in ๐ Enable more service autowiring by adding interface aliases to core modules Fixed
- Status changed to RTBC
over 1 year ago 12:08pm 16 June 2023 - last update
over 1 year ago 29,500 pass - last update
over 1 year ago 29,500 pass - last update
over 1 year ago 29,532 pass - last update
over 1 year ago 29,554 pass - last update
over 1 year ago 29,555 pass - last update
over 1 year ago 29,563 pass - last update
over 1 year ago 29,567 pass - last update
over 1 year ago 29,572 pass - last update
over 1 year ago 29,802 pass - last update
over 1 year ago 29,803 pass - last update
over 1 year ago 29,803 pass - last update
over 1 year ago 29,806 pass - last update
over 1 year ago 29,812 pass - last update
over 1 year ago 29,815 pass - last update
over 1 year ago 29,816 pass - last update
over 1 year ago 29,823 pass - last update
over 1 year ago 29,825 pass, 1 fail The last submitted patch, 95: 2926070-95.patch, failed testing. View results โ
- last update
about 1 year ago Patch Failed to Apply - First commit to issue fork.
- Merge request !5845Resolve #2926070. Deprecate ModuleHandlerInterface::getName() โ (Open) created by dimitriskr
- ๐ซ๐ทFrance andypost
Thank you for re-roll and updating deprecation to 10.3
- Status changed to Needs work
11 months ago 5:22pm 16 January 2024 The Needs Review Queue Bot โ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- ๐ฌ๐ทGreece dimitriskr
dimitriskr โ changed the visibility of the branch 11.x to hidden.
- Status changed to Needs review
10 months ago 10:10pm 13 February 2024 - Status changed to RTBC
10 months ago 5:09pm 16 February 2024 - Status changed to Needs work
10 months ago 5:05am 23 February 2024 The Needs Review Queue Bot โ tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".
This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.
Consult the Drupal Contributor Guide โ to find step-by-step guides for working with issues.
- Status changed to RTBC
10 months ago 5:34am 23 February 2024 - ๐ฆ๐บAustralia kim.pepper ๐โโ๏ธ๐ฆ๐บSydney, Australia
Rebased on 11.x. Back to RTBC
- Status changed to Needs work
10 months ago 1:29pm 4 March 2024 - Status changed to Needs review
10 months ago 5:28pm 4 March 2024 - Status changed to RTBC
10 months ago 6:06pm 4 March 2024 - Status changed to Fixed
10 months ago 6:17pm 4 March 2024 - ๐ฌ๐งUnited Kingdom catch
Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!
- ๐ท๐บRussia Chi
There is something wrong here. ExtensionList is marked as internal. We should not recommend using it in change records.
- ๐ฌ๐งUnited Kingdom catch
From the ExtensionList docs:
therefore there are no guarantees that the * internal implementations including constructor signature and protected * properties / methods will not change over time.
This doesn't apply to the existing public methods.
- ๐ท๐บRussia Chi
As long as it has class level
@internal
tag the whole class is considered as internal by static analyzers.
We might need to move the@internal
tag to particular methods in that class. Automatically closed - issue fixed for 2 weeks with no activity.