Problem/Motivation

Getting the latest version with in-place update of drupal core doesn't work currently. This is the link path: automatic_updates/in-place-update/drupal/core/8.7.4/8.8.0-beta1?token=38xjH0NED2qiSJcUtg0KDjh9BO4Aq1-BbfdxXNm3NwE

If I run the update, I get this message The website encountered an unexpected error. Please try again later.. Also, the web site doesn't work after this.

On the Update page (admin/reports/updates/update) it states the next possible version as 8.7.9:

Manual updates required
Name                            Installed version   Recommended version
Drupal core (Security update)   8.7.4               8.7.9 (Release notes)

So it looks like it gets a bit too far ahead, and uses 8.8.0-beta1, in stead of 8.7.9. But if I go to update.php and execute the updates, I end up with an actual working Drupal 8.8.0-beta1, which is pretty cool.

Cron-triggered update seems to give the same result, probably for the same reason.

Proposed resolution

Perhaps adding db_update is worth considering at this point? Redirecting the experimental manual method to update.php is another option.

Comments

ressa created an issue. See original summary.

ressa’s picture

Issue summary: View changes
heddn’s picture

Status: Active » Needs review
StatusFileSize
new5.62 KB

One thing we can do it make sure it doesn't jump minor (major) point releases from 8.7 to 8.8. This should fix that.

heddn’s picture

Working on the possible scenarios and options for running hook_update_N and (in 8.x) hook_post_update_NAME.

  • Add an settings option to run db updates (toggle on/off)
  • If db updates are available after upgrading, either run them or put site into maintenance mode.
    • I don't think we can get around not putting site in maintenance mode. It would be particularly useful with Drupal core security updates where a site owner wants to make sure the site is updated for security immediately but wants more control over running db updates.
heddn’s picture

Hmm, maybe we do 2 toggles with #states that enables the second.

Setting 1) run db updates (yes/no, default yes)
Setting 2) if no db updates, put site in maintenance mode (yes/no, default no)

ressa’s picture

I have just tried patch in #3, and it works perfectly, suggesting an update inside the proper release range, from 8.7.4 to 8.7.9, which went through flawlessly.

The db update logic you outline in #4 and #5 sounds reasonable.

heddn’s picture

heddn’s picture

For posterity sake, commenting that until we have A/B installs of the site, I don't think we can really easily decide if a code upgrade has an update hook that needs to be fired. Not in a non-brittle manner.

heddn’s picture

StatusFileSize
new15.42 KB
new10.43 KB

Here we add some tests and some other clean-up. Let's punt the db update stuffs to a follow-up.

heddn’s picture

heddn’s picture

StatusFileSize
new15.77 KB
new823 bytes
heddn’s picture

StatusFileSize
new4.58 KB

7.x backport

ressa’s picture

Thanks, patch from #11 works fine (Drupal 8).

ressa’s picture

Status: Needs review » Reviewed & tested by the community

Drupal 7 patch from #12 also works fine, I just upgraded from 7.61 to 7.67.

PS. Commands for Lando testing:

mkdir drutar7 && cd drutar7 && curl -sSL https://ftp.drupal.org/files/projects/drupal-7.61.tar.gz | tar -xz --strip-components=1

# get latest dev-version of module
curl -sSL https://ftp.drupal.org/files/projects/automatic_updates-7.x-1.x-dev.tar.gz | tar -xz -C sites/all/modules

# test a patch
cd sites/all/modules/automatic_updates/
wget https://www.drupal.org/files/issues/2019-11-12/3093861-7.x.txt
patch -p1 < 3093861-7.x.txt
cd -

# create Lando instance
lando init --recipe drupal7 --webroot . --name drutar7

  • heddn committed 0879205 on 8.x-1.x
    Issue #3093861 by heddn, ressa: Manual update (experimental) to 8.8.0-...

  • heddn committed 64c950f on 7.x-1.x
    Issue #3093861 by heddn, ressa: Manual update (experimental) to 8.8.0-...
heddn’s picture

Status: Reviewed & tested by the community » Fixed

@ressa thank you SO much for doing some manual testing. Committed and pushed to 8.x and 7.x.

ressa’s picture

No problem @heddn, I am only glad to help this project along any way I can. Thank you for all the great work you are doing on Automatic Updates, it will play a really important role in making Drupal a feasible CMS choice again for projects with limited resources.

heddn’s picture

Status: Fixed » Closed (fixed)

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