Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check requirements before upgrading extensions via the UI #15450

Merged
merged 1 commit into from
Oct 14, 2019

Conversation

mattwire
Copy link
Contributor

@mattwire mattwire commented Oct 8, 2019

Overview

If an extension introduces a requirement on another extension but is ALREADY installed it will download and (attempt) to install the extension without checking those dependencies. This can result in CiviCRM crashing if there is a hard dependence.

This happens quite often for example when upgrading Stripe from 5.4.1 to 6.x which introduces the mjwshared extension as a requirement.

Before

CiviCRM can stop working if an extension is "upgraded" via the UI and it's (new) requirements are not met.

After

CiviCRM allows you to click "upgrade" but then bounces back with an error message if any dependencies are not already installed.

image

Technical Details

We modify a couple of checkrequirements functions to allow us to pass through the info retrieved via the http feed (ie. the new extension we want to install) instead of using the local (old) versions.

Comments

It is always nice to extend these things further but any attempt to automatically download / install would require far more work - contributions welcome but let's get this fix in first.

@totten @MikeyMJCO @aydun

@civibot
Copy link

civibot bot commented Oct 8, 2019

(Standard links)

@civibot civibot bot added the master label Oct 8, 2019
@seamuslee001
Copy link
Contributor

(CiviCRM Review Template WORD-1.2)

  • I first ran a scenairo where i installed an old version of Mosaico extension which relied on both Shoreditch and Flexmailer. I then did the UI upgrade to the latest version which only relies on Flexmailer and confirmed that went through as expected
    I then downloaded an old version of the Stripe Extension and installed it, I then tried running hte upgrader and it failed due to an unmet dependancy. I then downloaded but not installed the dependancy and it still failed. After installing the depandancy then it succeeded.

I would say a future version should if all extensions are downloaded but not installed that the upgrade processes enables the dependancies

@mattwire
Copy link
Contributor Author

I would say a future version should if all extensions are downloaded but not installed that the upgrade processes enables the dependancies

@seamuslee001 Yes it would be nice. It's just the way the extension downloader / upgrader code works at the moment it would be a lot more work and a much riskier change. So I just went for the simple user message

@mattwire mattwire changed the base branch from master to 5.19 October 13, 2019 21:40
@civibot civibot bot added 5.19 and removed master labels Oct 13, 2019
@seamuslee001
Copy link
Contributor

Test failure unrelated merging

@seamuslee001 seamuslee001 merged commit bcc33cf into civicrm:5.19 Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants