diff --git a/.cspell-project-words.txt b/.cspell-project-words.txt index 3c907a81876aeed7e25246cbe74675b5d841e791..39b3e6e82094435afae917921cb7ad99d5b502db 100644 --- a/.cspell-project-words.txt +++ b/.cspell-project-words.txt @@ -13,3 +13,5 @@ NOCHANGES CURLOPT RETURNTRANSFER varchar +techdebt + diff --git a/project_browser.routing.yml b/project_browser.routing.yml index 2067321095503a258f05d5bb0e9c7876f1e67baa..3d25b613465604dd78efc75a1ccab779de09487e 100644 --- a/project_browser.routing.yml +++ b/project_browser.routing.yml @@ -19,11 +19,10 @@ project_browser.api_project_get_all: #options: # no_cache: 'TRUE' project_browser.browse: - path: '/admin/modules/browse/{source}/{id}' + path: '/admin/modules/browse/{source}' defaults: _controller: '\Drupal\project_browser\Controller\BrowserController::browse' _title: 'Browse projects' - id: null requirements: _permission: 'administer modules' project_browser.settings: diff --git a/src/Controller/BrowserController.php b/src/Controller/BrowserController.php index f1a8ae13f921bc7a625378ebc2702db25f247e00..0f1a7a736ebb7b0ac5a0b25d9bedacaa94805f90 100644 --- a/src/Controller/BrowserController.php +++ b/src/Controller/BrowserController.php @@ -26,18 +26,14 @@ class BrowserController extends ControllerBase { * * @param string $source * The ID of the source plugin to query for projects. - * @param string|null $id - * If viewing a specific project, the project's local ID (as known to the - * source plugin). * * @return array * A render array. */ - public function browse(string $source, ?string $id): array { + public function browse(string $source): array { return [ '#type' => 'project_browser', '#source' => $source, - '#id' => $id, ]; } diff --git a/src/Element/ProjectBrowser.php b/src/Element/ProjectBrowser.php index 1c91b87b9709813c35618996a7400069a89778d9..4175ba27b0820b64d84169790cf34d6eb0e5417b 100644 --- a/src/Element/ProjectBrowser.php +++ b/src/Element/ProjectBrowser.php @@ -97,8 +97,7 @@ final class ProjectBrowser implements ElementInterface, ContainerFactoryPluginIn */ public function attachProjectBrowserSettings(array $element): array { $element['#attached']['drupalSettings']['project_browser'] = $this->getDrupalSettings( - $element['#source'], - $element['#id'] ?? NULL + $element['#source'] ); return $element; } @@ -108,14 +107,11 @@ final class ProjectBrowser implements ElementInterface, ContainerFactoryPluginIn * * @param string $source * The ID of the source plugin to query for projects. - * @param string|null $id - * If viewing a specific project, the project's local ID (as known to the - * source plugin). * * @return array * An array of Drupal settings. */ - private function getDrupalSettings(string $source, ?string $id): array { + private function getDrupalSettings(string $source): array { $current_sources = [ $source => $this->enabledSourceHandler->getCurrentSources()[$source], ]; @@ -126,13 +122,11 @@ final class ProjectBrowser implements ElementInterface, ContainerFactoryPluginIn 'warnings' => [], 'status_checked' => FALSE, ]; - if (empty($id)) { - // @todo Fix https://www.drupal.org/node/3497624 to avoid adding - // hard-coded values. #techdebt - if ($source !== 'recipes' && $package_manager['available']) { - $package_manager = array_merge($package_manager, $this->installReadiness->validatePackageManager()); - $package_manager['status_checked'] = TRUE; - } + // @todo Fix https://www.drupal.org/node/3497624 to avoid adding + // hard-coded values. #techdebt + if ($source !== 'recipes' && $package_manager['available']) { + $package_manager = array_merge($package_manager, $this->installReadiness->validatePackageManager()); + $package_manager['status_checked'] = TRUE; } return [ diff --git a/src/Plugin/Derivative/LocalTaskDeriver.php b/src/Plugin/Derivative/LocalTaskDeriver.php index cb2d31d4a362f0eadd8378a07ee19d284d56b9a8..11e8b20cec79db4ed494ad66093a6477d2fc04c1 100644 --- a/src/Plugin/Derivative/LocalTaskDeriver.php +++ b/src/Plugin/Derivative/LocalTaskDeriver.php @@ -49,7 +49,6 @@ final class LocalTaskDeriver extends DeriverBase implements ContainerDeriverInte $source_id = $source->getPluginId(); $local_task['route_parameters'] = [ 'source' => $source_id, - 'id' => NULL, ]; $derivative_id = str_replace($source::DERIVATIVE_SEPARATOR, '__', $source_id); $this->derivatives[$derivative_id] = $local_task;