Commit 1d682073 authored by Gábor Hojtsy's avatar Gábor Hojtsy
Browse files

Issue #3253650 by Gábor Hojtsy: Upgrade plans are now for Drupal 10 only,...

Issue #3253650 by Gábor Hojtsy: Upgrade plans are now for Drupal 10 only, don't display them in Drupal 8
parent 364e862e
Loading
Loading
Loading
Loading
+0 −1
Changes for src/Form/UpgradeStatusForm.php: 0 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -507,7 +507,6 @@ class UpgradeStatusForm extends FormBase {
        ];
      }
      else {
        $plan = (string) $this->projectCollector->getPlan($name);
        $option['issues'] = [
          'data' => [
            'label' => [
+9 −4
Changes for src/ProjectCollector.php: 9 added lines, 4 removed lines.
Original line number Diff line number Diff line
@@ -441,22 +441,27 @@ class ProjectCollector {
  }

  /**
   * Get the Drupal 9 plan for a project, either explicitly fetched or cached.
   * Get the Drupal 10 plan for a project, either explicitly fetched or cached.
   *
   * @param string $project_machine_name
   *   Machine name for project.
   *
   * @return NULL|string
   *   Either NULL or the Drupal 9 plan for the project.
   *   Either NULL or the Drupal 10 plan for the project.
   */
  public function getPlan(string $project_machine_name) {
    // Return explicitly fetched Drupal 9 plan if available.
    // Drupal 9 plans are discontinued, return NULL on Drupal 8.
    if ($this->getDrupalCoreMajorVersion() < 9) {
      return NULL;
    }

    // Return explicitly fetched Drupal 10 plan if available.
    $result = $this->getResults($project_machine_name);
    if (!empty($result) && !empty($result['plans'])) {
      return $result['plans'];
    }

    // Read our shipped snapshot of Drupal 9 plans to find this one.
    // Read our shipped snapshot of Drupal 10 plans to find this one.
    $file = fopen(drupal_get_path('module', 'upgrade_status') . '/project_plans.csv', 'r');
    while ($line = fgetcsv($file, 0, ";")) {
      if ($line[0] == $project_machine_name) {