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#1447 Fix upgrade error when duplicate option group names #16033

Merged
merged 2 commits into from
Dec 7, 2019

Conversation

seamuslee001
Copy link
Contributor

@seamuslee001 seamuslee001 commented Dec 5, 2019

Overview

This fixes a hard fail that can happen in the upgrade process if the same name as the fixed name for an option group already exists in the database

https://lab.civicrm.org/dev/core/issues/1447

Before

Hard Fail in upgrade can happen

After

No hard fail and report generated of option groups that couldn't be fixed

ping @mlutfy

…database when trying to fix the option group name
@civibot
Copy link

civibot bot commented Dec 5, 2019

(Standard links)

@civibot civibot bot added the master label Dec 5, 2019
@mlutfy
Copy link
Member

mlutfy commented Dec 6, 2019

I did a test run (after manually creating an option group with a conflicting name)

> select * from civicrm_option_group where name like '%rating%';
+-----+-------------------------------+----------------+-------------+-------------+-----------+-----------+-----------+
| id  | name                          | title          | description | is_reserved | is_active | is_locked | data_type |
+-----+-------------------------------+----------------+-------------+-------------+-----------+-----------+-----------+
| 358 | numeric_rating                | Numeric Rating | NULL        |           1 |         1 |         0 | Integer   |
| 359 | numeric_rating_20171003141125 | Numeric rating | NULL        |           0 |         1 |         0 | String    |
| 377 | numeric rating                | numeric rating | test by bgm |           1 |         1 |         0 | Integer   |
+-----+-------------------------------+----------------+-------------+-------------+-----------+-----------+-----------+

and indeed got:

Upgrade outputs:
The Following option Groups have not been converted due to there being
already another option group with the same name in the database

        * numeric rating

and other than the warning, everything went well.

Should the PR be aginst the RC / 5.21?

@seamuslee001 seamuslee001 changed the base branch from master to 5.21 December 6, 2019 22:30
@civibot civibot bot added 5.21 and removed master labels Dec 6, 2019
@mlutfy mlutfy added the merge ready PR will be merged after a few days if there are no objections label Dec 6, 2019
@mlutfy mlutfy merged commit 292da97 into civicrm:5.21 Dec 7, 2019
@mlutfy mlutfy changed the title dev/core#1447 Fix hard fail on upgrade due to duplicate names in the … dev/core#1447 Fix upgrade error when duplicate option group names Dec 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.21 merge ready PR will be merged after a few days if there are no objections
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants