Skip to content
Snippets Groups Projects
Commit 803fa695 authored by catch's avatar catch
Browse files

Issue #3414172 by quietone: In update module convert comments to use install/uninstall

parent 0697c814
No related branches found
No related tags found
31 merge requests!11131[10.4.x-only-DO-NOT-MERGE]: Issue ##2842525 Ajax attached to Views exposed filter form does not trigger callbacks,!9470[10.3.x-only-DO-NOT-MERGE]: #3331771 Fix file_get_contents(): Passing null to parameter,!8540Issue #3457061: Bootstrap Modal dialog Not closing after 10.3.0 Update,!8528Issue #3456871 by Tim Bozeman: Support NULL services,!8373Issue #3427374 by danflanagan8, Vighneshh: taxonomy_tid ViewsArgumentDefault...,!7526Expose roles in response,!7352Draft: Resolve #3203489 "Set filename as",!3878Removed unused condition head title for views,!3818Issue #2140179: $entity->original gets stale between updates,!3742Issue #3328429: Create item list field formatter for displaying ordered and unordered lists,!3731Claro: role=button on status report items,!3668Resolve #3347842 "Deprecate the trusted",!3651Issue #3347736: Create new SDC component for Olivero (header-search),!3531Issue #3336994: StringFormatter always displays links to entity even if the user in context does not have access,!3355Issue #3209129: Scrolling problems when adding a block via layout builder,!3154Fixes #2987987 - CSRF token validation broken on routes with optional parameters.,!3133core/modules/system/css/components/hidden.module.css,!2964Issue #2865710 : Dependencies from only one instance of a widget are used in display modes,!2812Issue #3312049: [Followup] Fix Drupal.Commenting.FunctionComment.MissingReturnType returns for NULL,!2794Issue #3100732: Allow specifying `meta` data on JSON:API objects,!2378Issue #2875033: Optimize joins and table selection in SQL entity query implementation,!2334Issue #3228209: Add hasRole() method to AccountInterface,!2062Issue #3246454: Add weekly granularity to views date sort,!1105Issue #3025039: New non translatable field on translatable content throws error,!1073issue #3191727: Focus states on mobile second level navigation items fixed,!10223132456: Fix issue where views instances are emptied before an ajax request is complete,!877Issue #2708101: Default value for link text is not saved,!617Issue #3043725: Provide a Entity Handler for user cancelation,!579Issue #2230909: Simple decimals fail to pass validation,!560Move callback classRemove outside of the loop,!555Issue #3202493
Pipeline #112213 canceled
Pipeline: drupal

#112215

    Showing
    with 49 additions and 49 deletions
    ......@@ -52,7 +52,7 @@ class UpdateReady extends FormBase {
    * @param string $root
    * The root location under which updated projects will be saved.
    * @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
    * The object that manages enabled modules in a Drupal installation.
    * The object that manages installed modules in a Drupal installation.
    * @param \Drupal\Core\State\StateInterface $state
    * The state key value store.
    * @param string $site_path
    ......
    ......@@ -123,7 +123,8 @@ public function buildFetchUrl(array $project, $site_key = '') {
    $url .= '/' . $name . '/current';
    // Only append usage information if we have a site key and the project is
    // enabled. We do not want to record usage statistics for disabled projects.
    // installed. We do not want to record usage statistics for uninstalled
    // projects.
    if (!empty($site_key) && !str_contains($project['project_type'], 'disabled')) {
    // Append the site key.
    $url .= str_contains($url, '?') ? '&' : '?';
    ......@@ -136,7 +137,7 @@ public function buildFetchUrl(array $project, $site_key = '') {
    $url .= rawurlencode($project['info']['version']);
    }
    // Append the list of modules or themes enabled.
    // Append the list of modules or themes installed.
    $list = array_keys($project['includes']);
    $url .= '&list=';
    $url .= rawurlencode(implode(',', $list));
    ......
    ......@@ -42,7 +42,7 @@ class UpdateManager implements UpdateManagerInterface {
    protected $updateProcessor;
    /**
    * An array of installed and enabled projects.
    * An array of installed projects.
    *
    * @var array
    */
    ......
    ......@@ -33,7 +33,7 @@ interface UpdateManagerInterface {
    const CURRENT = 5;
    /**
    * Fetches an array of installed and enabled projects.
    * Fetches an array of installed projects.
    *
    * This is only responsible for generating an array of projects (taking into
    * account projects that include more than one module or theme). Other
    ......@@ -51,7 +51,7 @@ interface UpdateManagerInterface {
    * automatically clear this data.
    *
    * @return array
    * An associative array of currently enabled projects keyed by the
    * An associative array of currently installed projects keyed by the
    * machine-readable project short name. Each project contains:
    * - name: The machine-readable project short name.
    * - info: An array with values from the main .info.yml file for this
    ......@@ -70,8 +70,8 @@ interface UpdateManagerInterface {
    * human-readable name as value.
    * - project_type: The type of project. Allowed values are 'module' and
    * 'theme'.
    * - project_status: This indicates if the project is enabled and will
    * always be TRUE, as the function only returns enabled projects.
    * - project_status: This indicates if the project is installed and will
    * always be TRUE, as the function only returns installed projects.
    *
    * @see update_process_project_info()
    * @see update_calculate_project_data()
    ......
    ......@@ -78,7 +78,7 @@ public function __toString(): string {
    // the Update Manager to be tested) and also ensures that new project files
    // added there won't be visible to the parent site and will be properly
    // cleaned up once the test finishes running. This is done here (rather
    // than having the tests enable a module which overrides the update root
    // than having the tests install a module which overrides the update root
    // factory service) to ensure that the parent site is automatically kept
    // clean without relying on test authors to take any explicit steps. See
    // also \Drupal\update\Tests\Functional\UpdateTestBase::setUp().
    ......
    ......@@ -55,10 +55,9 @@ public function updateTest($project_name, $version) {
    $availability_scenario = $xml_map['#all'];
    }
    else {
    // The test didn't specify (for example, the webroot has other modules and
    // themes installed but they're disabled by the version of the site
    // running the test. So, we default to a file we know won't exist, so at
    // least we'll get an empty xml response instead of a bunch of Drupal page
    // The test didn't specify a project nor '#all' (for all extensions on the
    // system). So, we default to a file we know won't exist, so at least
    // we'll get an empty xml response instead of a bunch of Drupal page
    // output.
    $availability_scenario = '#broken#';
    }
    ......
    ......@@ -337,14 +337,14 @@ public function testNormalUpdateAvailable() {
    }
    /**
    * Tests that disabled themes are only shown when desired.
    * Tests that uninstalled themes are only shown when desired.
    *
    * @todo https://www.drupal.org/node/2338175 extensions can not be hidden and
    * base themes have to be installed.
    */
    public function testUpdateShowDisabledThemes() {
    $update_settings = $this->config('update.settings');
    // Make sure all the update_test_* themes are disabled.
    // Make sure all the update_test_* themes are uninstalled.
    $extension_config = $this->config('core.extension');
    foreach ($extension_config->get('theme') as $theme => $weight) {
    if (str_starts_with($theme, 'update_test_')) {
    ......
    ......@@ -120,7 +120,7 @@ public function testUploadModule() {
    $info = $info_parser->parse($installedInfoFilePath);
    $this->assertEquals('8.x-1.0', $info['version']);
    // Enable the module.
    // Install the module.
    $this->drupalGet('admin/modules');
    $this->submitForm(['modules[update_test_new_module][enable]' => TRUE], 'Install');
    ......
    ......@@ -60,7 +60,7 @@ public static function providerTemplatePreprocessUpdateReport() {
    }
    /**
    * Tests the error message when failing to fetch data without dblog enabled.
    * Tests the error message when failing to fetch data without dblog installed.
    *
    * @see template_preprocess_update_fetch_error_message()
    */
    ......@@ -82,7 +82,7 @@ public function testTemplatePreprocessUpdateFetchErrorMessageNoDblog() {
    }
    /**
    * Tests the error message when failing to fetch data with dblog enabled.
    * Tests the error message when failing to fetch data with dblog installed.
    *
    * @see template_preprocess_update_fetch_error_message()
    */
    ......
    ......@@ -131,14 +131,14 @@ public static function providerTestUpdateBuildFetchUrl() {
    $data[] = [$project, $site_key, $expected];
    // For disabled projects it shouldn't add the site key either.
    // For uninstalled projects it shouldn't add the site key either.
    $site_key = 'site_key';
    $project['project_type'] = 'disabled';
    $expected = "http://www.example.com/{$project['name']}/current";
    $data[] = [$project, $site_key, $expected];
    // For enabled projects, test adding the site key.
    // For installed projects, test adding the site key.
    $project['project_type'] = '';
    $expected = "http://www.example.com/{$project['name']}/current";
    $expected .= '?site_key=site_key';
    ......
    ......@@ -18,20 +18,20 @@
    * Most modules will never need to implement this hook. It is for advanced
    * interaction with the Update Manager module. The primary use-case for this
    * hook is to add projects to the list; for example, to provide update status
    * data on disabled modules and themes. A contributed module might want to hide
    * projects from the list; for example, if there is a site-specific module that
    * doesn't have any official releases, that module could remove itself from this
    * list to avoid "No available releases found" warnings on the available updates
    * report. In rare cases, a module might want to alter the data associated with
    * a project already in the list.
    * data on uninstalled modules and themes. A contributed module might want to
    * hide projects from the list; for example, if there is a site-specific module
    * that doesn't have any official releases, that module could remove itself from
    * this list to avoid "No available releases found" warnings on the available
    * updates report. In rare cases, a module might want to alter the data
    * associated with a project already in the list.
    *
    * @param $projects
    * Reference to an array of the projects installed on the system. This
    * includes all the metadata documented in the comments below for each project
    * (either module or theme) that is currently enabled. The array is initially
    * populated inside \Drupal\update\UpdateManager::getProjects() with the help
    * of \Drupal\Core\Utility\ProjectInfo->processInfoList(), so look there for
    * examples of how to populate the array with real values.
    * (either module or theme) that is currently installed. The array is
    * initially populated inside \Drupal\update\UpdateManager::getProjects() with
    * the help of \Drupal\Core\Utility\ProjectInfo->processInfoList(), so look
    * there for examples of how to populate the array with real values.
    *
    * @see \Drupal\update\UpdateManager::getProjects()
    * @see \Drupal\Core\Utility\ProjectInfo::processInfoList()
    ......@@ -40,38 +40,38 @@ function hook_update_projects_alter(&$projects) {
    // Hide a site-specific module from the list.
    unset($projects['site_specific_module']);
    // Add a disabled module to the list.
    // Add an uninstalled module to the list.
    // The key for the array should be the machine-readable project "short name".
    $projects['disabled_project_name'] = [
    $projects['uninstalled_project_name'] = [
    // Machine-readable project short name (same as the array key above).
    'name' => 'disabled_project_name',
    'name' => 'uninstalled_project_name',
    // Array of values from the main .info.yml file for this project.
    'info' => [
    'name' => 'Some disabled module',
    'description' => 'A module not enabled on the site that you want to see in the available updates report.',
    'name' => 'Some uninstalled module',
    'description' => 'A module not installed on the site that you want to see in the available updates report.',
    'version' => '8.x-1.0',
    'core' => '8.x',
    // The maximum file change time (the "ctime" returned by the filectime()
    // PHP method) for all of the .info.yml files included in this project.
    '_info_file_ctime' => 1243888165,
    ],
    // The date stamp when the project was released, if known. If the disabled
    // project was an officially packaged release from drupal.org, this will
    // be included in the .info.yml file as the 'datestamp' field. This only
    // really matters for development snapshot releases that are regenerated,
    // so it can be left undefined or set to 0 in most cases.
    // The date stamp when the project was released, if known. If the
    // uninstalled project was an officially packaged release from drupal.org,
    // this will be included in the .info.yml file as the 'datestamp' field.
    // This only really matters for development snapshot releases that are
    // regenerated, so it can be left undefined or set to 0 in most cases.
    'datestamp' => 1243888185,
    // Any modules (or themes) included in this project. Keyed by machine-
    // readable "short name", value is the human-readable project name printed
    // in the UI.
    'includes' => [
    'disabled_project' => 'Disabled module',
    'disabled_project_helper' => 'Disabled module helper module',
    'disabled_project_foo' => 'Disabled module foo add-on module',
    'uninstalled_project' => 'uninstalled module',
    'uninstalled_project_helper' => 'uninstalled module helper module',
    'uninstalled_project_foo' => 'uninstalled module foo add-on module',
    ],
    // Does this project contain a 'module', 'theme', 'disabled-module', or
    // 'disabled-theme'?
    'project_type' => 'disabled-module',
    // Does this project contain a 'module', 'theme', 'uninstalled-module', or
    // 'uninstalled-theme'?
    'project_type' => 'uninstalled-module',
    ];
    }
    ......
    ......@@ -19,7 +19,7 @@
    * there is no update data, only one record will be returned, indicating that
    * the status of core can't be determined. If data is available, there will be
    * two records: one for core, and another for all of contrib (assuming there
    * are any contributed modules or themes enabled on the site). In addition to
    * are any contributed modules or themes installed on the site). In addition to
    * the fields expected by hook_requirements ('value', 'severity', and
    * optionally 'description'), this array will contain a 'reason' attribute,
    * which is an integer constant to indicate why the given status is being
    ......
    ......@@ -251,8 +251,8 @@ function _update_no_data() {
    /**
    * Tries to get update information and refreshes it when necessary.
    *
    * In addition to checking the lifetime, this function also ensures that
    * there are no .info.yml files for enabled modules or themes that have a newer
    * In addition to checking the lifetime, this function also ensures that there
    * are no .info.yml files for installed modules or themes that have a newer
    * modification timestamp than the last time we checked for available update
    * data. If any .info.yml file was modified, it almost certainly means a new
    * version of something was installed. Without fresh available update data, the
    ......
    • catch @catch

      mentioned in commit 4bc99437

      ·

      mentioned in commit 4bc99437

      Toggle commit list
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment