Problem/Motivation

Follow-up to #3087644: Remove Drupal 8 updates up to and including 88**.

Blocks Drupal 9 beta.

Proposed resolution

1. Remove the update

2. Add a workspace-specific message to inform any workspaces 8.8.0 users trying to go direct to 9.0.0, that they need to update to 8.8.2 or higher first.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

Existing Drupal 8 sites using the workspaces module must update to at least Drupal 8.8.2 prior to updating to Drupal 9.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

catch created an issue. See original summary.

catch’s picture

Title: Remove workspace_update_8003() and associated post-update, or re-add test coverage » Remove workspace_update_8803() and associated post-update, or re-add test coverage
jibran’s picture

Status: Postponed » Active
DamienMcKenna’s picture

Tagging as a requirement for Drupal 9.0-beta1.

DamienMcKenna’s picture

When will the decision be made on what direction to take?

catch’s picture

Good question, tagging so this doesn't drop off the radar - we only moved it to a follow-up so the other issue could get committed as quickly as possible, but nothing blocks this one being decided and resolved.

For me I would remove it:

1. If we keep it in, we need to support a fairly complex update all the way from 8.8 to 9.4+ and there's a good chance that will cause us problems later.

2. Workspaces is still experimental, so I think it's OK to expect people to update to the latest patch release of 8.x prior to 9.x.

3. We can add some explicit messaging following #3098475: Add more strict checking of hook_update_last_removed() and better explanation to inform people exactly what they need to do if they try to update from an older database with workspaces installed.

4. The only reason we have the update post-8.8.0 was because it was fixing a critical bug in the pre-8.8.0 upgrade path, so it is not really a new update added after 8.8.0's release as such, but an old one split into two.

The main reason to keep it would be so that workspaces users don't have any different steps to do from any other Drupal 9 user however:

- other sites might also have to update to later patch releases to have other critical upgrade path bugfixes applied
- being prevented from updating via hook_update_last_removed() is better than us allowing someone to update against 9.3 or 9.4 and hitting a compatibility issue with a later update that we didn't catch with automated tests for some reason.

catch’s picture

Issue summary: View changes
Status: Active » Needs review

Here's a patch for the update removal.

Removing the post update will need to happen in #3106666: Remove post updates added prior to 8.8.0 still.

If we agree to remove the update, we'll need a follow-up here to address point #2 of the issue summary.

catch’s picture

amateescu’s picture

Status: Needs review » Reviewed & tested by the community

I definitely agree that we should remove this update function in 9.0.x, it makes everything much simpler for most (99% ?) Drupal installs, and the relatively small number of sites that are using core Workspaces can easily update to the latest 8.8.x release before going to 9.0.x.

Regarding the second point form the issue summary, I've read the patch from #3098475-38: Add more strict checking of hook_update_last_removed() and better explanation and, as far as I can tell, it already doesn't allow a site to upgrade if the installed schema version is lower than the value returned by hook_update_last_removed(), so I'm not sure why we'd need a workspace-specific message to that requirements check..

amateescu’s picture

Just discussed this issue with @Berdir and now I see the usefulness of having a workspace-specific message for upgrades from 8.x to 9.x.

We agreed that either this patch or the one from #3098475: Add more strict checking of hook_update_last_removed() and better explanation should be updated, depending on which issue lands first :)

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 8: 3108416.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

Berdir’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated PHPunit deprecation test fail.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

This will need a reroll - also perhaps we need to wait to see how #3098427-77: Manipulating the revision metadata keys before running the BC layer breaks the BC layer plays out.

xjm’s picture

I guess I am very reluctantly OK with removing this given the complexities of maintaining it, including #3098427: Manipulating the revision metadata keys before running the BC layer breaks the BC layer and the fact that we've had to fix it like three times already before that. I don't totally love it because beta experimental modules are supposed to have the same upgrade path continuity requirements as stable modules, but mentioning it in the release notes (especially once #3098475: Add more strict checking of hook_update_last_removed() and better explanation is fixed) is probably an OK tradeoff given the complexities of maintaining it.

catch’s picture

Status: Needs work » Needs review
FileSize
3.15 KB
1.84 KB

Now that #3098475: Add more strict checking of hook_update_last_removed() and better explanation has landed we can customize the error message here.

To start, here's one using exactly the same message as for system module, just with the version number changed.

catch’s picture

Issue summary: View changes
FileSize
100.01 KB
alexpott’s picture

I think we can have less duplication by doing

    // If system.module is in the list then only show a specific message for
    // Drupal core, otherwise show a more generic message for each module.
    if (isset($module_list['system'])) {
      $requirements['system_update_last_removed'] = [
        'title' => t('The version of Drupal you are trying to update from is too old'),
        'description' => t('Updating to Drupal @current_major is only supported from Drupal version @required_min_version or higher. If you are trying to update from an older version, first update to the latest version of Drupal @previous_major. (<a href=":url">Drupal 9 upgrade guide</a>)', [
          '@current_major' => 9,
          // Workspaces is special cased due to updates being removed after
          // 8.8.0.
          '@required_min_version' => isset($module_list['workspaces']) ? '8.8.2' : '8.8.0',
          '@previous_major' => 8,
          ':url' => 'https://www.drupal.org/docs/9/how-to-prepare-your-drupal-7-or-8-site-for-drupal-9/upgrading-a-drupal-8-site-to-drupal-9',
        ]),
        'severity' => REQUIREMENT_ERROR,
      ];
    }

Less duplicate strings to maintain.

catch’s picture

There are three cases to worry about here,, #17 breaks one of them I think.

1. You do not have workspaces installed, and are updating from a version prior to 8.8.0 to 9.x

2. You do have workspaces installed, and are updating from a version prior to 8.8.0 to 9.x

3. You do have workspaces installed, and are updating from 8.8.0 or 8.8.1 to 9.x

In the third scenario, workspaces will be in the list of modules, but system will not be, so we would not show the message.

catch’s picture

Discussed briefly in slack, this should reduce the duplication but also cover all cases.

xjm’s picture

Issue tags: +Needs release note
catch’s picture

Issue summary: View changes
Issue tags: -Needs release note
amateescu’s picture

Status: Needs review » Reviewed & tested by the community

#19 looks great to me!

catch’s picture

Note that the actual post update removal happens in #3106666: Remove post updates added prior to 8.8.0, which depends on #3066801: Add hook_removed_post_updates(), and also deals with workspaces' other post updates.

alexpott’s picture

Title: Remove workspace_update_8803() and associated post-update, or re-add test coverage » Remove workspace_update_8803()
Issue summary: View changes

Post updates are being handled by another issue.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 6cad09c and pushed to 9.0.x. Thanks!

diff --git a/core/modules/system/system.install b/core/modules/system/system.install
index 6d3e63988b..317304ba09 100644
--- a/core/modules/system/system.install
+++ b/core/modules/system/system.install
@@ -1106,7 +1106,6 @@ function system_requirements($phase) {
       }
     }
 
-
     // If system or workspaces is in the list then only show a specific message
     // for Drupal core.
     if (isset($module_list['system']) || isset($module_list['workspaces'])) {
diff --git a/core/modules/workspaces/workspaces.install b/core/modules/workspaces/workspaces.install
index 047134fd44..75185603c1 100644
--- a/core/modules/workspaces/workspaces.install
+++ b/core/modules/workspaces/workspaces.install
@@ -5,7 +5,6 @@
  * Contains install, update and uninstall functions for the Workspaces module.
  */
 
-use Drupal\Core\Entity\ContentEntityNullStorage;
 use Drupal\Core\Entity\EntityTypeInterface;
 use Drupal\workspaces\Entity\Workspace;
 

Fixed coding standards on commit.

  • alexpott committed 6cad09c on 9.0.x
    Issue #3108416 by catch, amateescu, alexpott, xjm: Remove...
alexpott’s picture

Issue tags: +9.0.0 release notes

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.