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

dev/financial#84 - Fix upgrade failure. Thin-out activation logic for sequentialcreditnotes. #16971

Merged
merged 1 commit into from
Apr 3, 2020

Conversation

totten
Copy link
Member

@totten totten commented Apr 3, 2020

Overview

This fixes an issue with running the upgrade on certain builds. It addresses the problem by reducing the number of services/layers involved with activating the sequentialcreditnotes extension.

Related: https://civicrm.stackexchange.com/a/35260/93

Steps to reproduce

  • Create a site based on wp-demo with Civi 5.21
  • Make a DB snapshot
  • Update code to 5.24
  • In the web UI, run the DB upgrade
    • Note: It's important to use the web UI. The problem does not reproduce in CLI.

Before

(1) The upgrader activates sequentialcreditnotes using the Extension.install API

(2) The upgrader freezes on "Upgrade DB to 5.24.alpha1". The CiviCRM.log includes:

Apr 03 14:41:50  [info] Running task: Upgrade DB to 5.24.alpha1: SQL

Apr 03 14:41:55  [info] Running task: Install sequential creditnote extension

Apr 03 14:42:14  [info] $CRM_Queue_ErrorPolicy_reportError = Array
(
    [is_error] => 1
    [is_continue] => 0
    [exception] => Error 1: Uncaught Error: Class 'CRM_Volunteer_Permission' not found in /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/tools/extensions/civivolunteer/volunteer.php:497
Stack trace:
0 /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(286): volunteer_civicrm_permission(Array)
1 /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(139): CRM_Utils_Hook->runHooks(Array, 'civicrm_permiss...', 1, Array, NULL, NULL, NULL, NULL, NULL)
2 /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(86): CRM_Utils_Hook_WordPress->invokeViaUF(1, Array, NULL, NULL, NULL, NULL, NULL, 'civicrm_permiss...')
3 /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(184): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\GenericHookEvent), 'hook_civicrm_p
    [last_task_title] => Install sequential creditnote extension
)

After

(1) The upgrader activates sequentialcreditnotes using a SQL insert.

(2) The upgrade completes. After installation, the sequentialcreditnotes extension is active.

Steps to reproduce
------------------

* Create a site based on `wp-demo` with Civi 5.21
* Make a DB snapshot
* Update code to 5.24
* In the web UI, run the DB upgrade
    * Note: It's important to use the web UI. The problem does not reproduce in CLI.

Before
------

The upgrader freezes on "Upgrade DB to 5.24.alpha1". The `CiviCRM.log` includes:

```
Apr 03 14:41:50  [info] Running task: Upgrade DB to 5.24.alpha1: SQL

Apr 03 14:41:55  [info] Running task: Install sequential creditnote extension

Apr 03 14:42:14  [info] $CRM_Queue_ErrorPolicy_reportError = Array
(
    [is_error] => 1
    [is_continue] => 0
    [exception] => Error 1: Uncaught Error: Class 'CRM_Volunteer_Permission' not found in /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/tools/extensions/civivolunteer/volunteer.php:497
Stack trace:
0 /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook.php(286): volunteer_civicrm_permission(Array)
1 /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/CRM/Utils/Hook/WordPress.php(139): CRM_Utils_Hook->runHooks(Array, 'civicrm_permiss...', 1, Array, NULL, NULL, NULL, NULL, NULL)
2 /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/Civi/Core/CiviEventDispatcher.php(86): CRM_Utils_Hook_WordPress->invokeViaUF(1, Array, NULL, NULL, NULL, NULL, NULL, 'civicrm_permiss...')
3 /home/me/bknix/build/wpmaster/web/wp-content/plugins/civicrm/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(184): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\GenericHookEvent), 'hook_civicrm_p
    [last_task_title] => Install sequential creditnote extension
)
```

After
-----

The upgrade completes. After installation, the `sequentialcreditnotes` extension is active.
@civibot
Copy link

civibot bot commented Apr 3, 2020

(Standard links)

@civibot civibot bot added the 5.25 label Apr 3, 2020
@totten totten changed the title dev/financial#84 - Fix "wp-demo" upgrade scenario. Simplify upgrader. dev/financial#84 - Fix upgrade failure. Thin-out activation logic for sequentialcreditnotes. Apr 3, 2020
@eileenmcnaughton
Copy link
Contributor

Looks good to me - as our first foray in this direction we are flushing out the pointy bits

@seamuslee001 seamuslee001 merged commit 40d312e into civicrm:5.25 Apr 3, 2020
@totten totten deleted the 5.25-seqcredit branch April 5, 2020 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants