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/core#1360: Fix Programatic Installation Of Multiple Extensions on v5.19 #15724

Conversation

MiyaNoctem
Copy link
Contributor

Overview

We have a drupal profile we use to install drupal sites with CiviCRM and some common extensions. When running the profile, CiviCRM is upgraded to v5.19. After that, the extensions are installed, however, the first extension installation causes a database exception to be thrown. It doesn't matter what extension is installed, every time, the installation of the first extension will fail.

Before

  1. Upgrade upgrade_5_19_alpha1() creates a new field on civicrm_status_pref table. https://github.com/civicrm/civicrm-core/blob/master/CRM/Upgrade/Incremental/php/FiveNineteen.php#L69-L74
  2. At the end of the installation of the first extension, schema is synched by comparing the columns of every table in CiviCRM with its correspondig logging table, however, the columnStats cache in \Civi:$statics has already been be initialized, with civicrm_status_pref table missing the new is_active column.
  3. Schema is synched using cached values for columnStats. System erroneously detects log_civicrm_status_pref is missing the is_active column and tries to create it again, causing the exception to be thrown.

After

I've added a method that resets the columnStats cache when rebuilding the complete schema, in order to make sure we use the actual state of the schema when doing the sync.

@civibot
Copy link

civibot bot commented Nov 4, 2019

(Standard links)

@MiyaNoctem MiyaNoctem force-pushed the dev-core-1360-fix-programatic-installation-of-extensions-v519 branch from 629183e to a40a5a4 Compare November 4, 2019 12:45
@MiyaNoctem
Copy link
Contributor Author

@eileenmcnaughton , here's the PR sending the fix to v5.19 branch. Jenkins has finished building and testing.

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