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#1911 - Default not being set for fixed contribution amounts or any price field that is not type text #17960

Merged
merged 1 commit into from
Jul 26, 2020

Conversation

demeritcowboy
Copy link
Contributor

@demeritcowboy demeritcowboy commented Jul 26, 2020

Overview

https://lab.civicrm.org/dev/core/-/issues/1911

The default setting for price field options no longer works as of 5.27.

Easiest way to see is:

  1. On a stock demo site go to the amounts tab for the "Help Support CiviCRM" contribution page.
  2. Observe that "Booster $10" is the default amount.
  3. Just click save.
  4. Go back to the amounts tab. Nothing is set as default.
  5. Also if you visit the live page no default is selected.

You can also see it if you:

  1. Create a price set.
  2. Add a price field that is not type text, like type select.
  3. Create a few options and set one as a default.
  4. Go back and look at it and it's not the default.

Before

Can't have a default option for a price field.

After

Can

Technical Details

This commit rearranged the order.

Before, what it would do is clear out any other is_default, and THEN save the BAO which would set the new is_default.

After, it does the save before that clearout, so is_default gets set but then wiped out.

Comments

Has test.

There's also something else going on where the Review Your Contribution button does nothing when you click it if you don't have a default. That seems separate and seems to have changed in 5.28 not 5.27.

@civibot
Copy link

civibot bot commented Jul 26, 2020

(Standard links)

@civibot civibot bot added the 5.28 label Jul 26, 2020
@demeritcowboy demeritcowboy force-pushed the contribution-default branch from e642bb5 to 50a890f Compare July 26, 2020 19:27
@demeritcowboy demeritcowboy changed the title [WIP] dev/core#1911 - Default not being set for fixed contribution amounts dev/core#1911 - Default not being set for fixed contribution amounts Jul 26, 2020
@demeritcowboy demeritcowboy changed the title dev/core#1911 - Default not being set for fixed contribution amounts dev/core#1911 - Default not being set for fixed contribution amounts or any price field that is not type text Jul 26, 2020
@seamuslee001
Copy link
Contributor

(CiviCRM Review Template WORD-1.2)

  • General standards
    • (r-explain) Pass
    • (r-user) Pass
    • (r-doc) Pass
    • (r-run) Pass I was able to replicate this issue locally and confirmed that this fixed the problem
  • Developer standards

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.

2 participants