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

Unable to mark price set field as inactive #13257

Conversation

vinuvarshith
Copy link
Contributor

Overview

When you edit a price field (via CiviCRM/Events/Manage Price Sets/View and Edit Price Fields/Edit Price Field) and uncheck the "Active?" checkbox and click save, the change is not saved and the field remains active. This fail only for Text/Numeric. Checking the "Active?" (when the field is disabled) it does work and the field is enabled.
screenshot-1 1

After

We can set a price field to both 'enabled' and 'inactive' without issues

Technical Details

In CRM/Price/Form/Field.php postprocess, when html_type is 'Text', the params are modified as per the option group and option value. Here 'is_active' param is always set to 1 and so it cannot be set to inactive.
This PR fixes it by using 'is_active' from params instead of always using 1.

@civibot
Copy link

civibot bot commented Dec 12, 2018

(Standard links)

@civibot civibot bot added the master label Dec 12, 2018
@eileenmcnaughton eileenmcnaughton changed the title BASW-316: Unable to mark price set field as inactive Unable to mark price set field as inactive Dec 13, 2018
@eileenmcnaughton
Copy link
Contributor

So that line was added by @alifrumin in 2017 in 2db35bf - my take on it is that the line could & should be removed & may have been added by accident.

I see it being set correctly higher up

    $params['is_active'] = CRM_Utils_Array::value('is_active', $params, FALSE);
``

@alifrumin any thoughts

@alifrumin
Copy link
Contributor

@eileenmcnaughton I agree that line should not be hardcoded to equal 1. I am not sure how that snuck in there.

I am happy to test this when its ready.

@eileenmcnaughton
Copy link
Contributor

@vinuvarshith per above can you edit to remove that line altogether?

@vinuvarshith
Copy link
Contributor Author

@eileenmcnaughton @alifrumin
Thanks for confirming. I have updated by removing that line.

@alifrumin
Copy link
Contributor

I tested this on the Jenkins build based off of @vinuvarshith solid documentation at the top and it is ready to merge from my perspective.

@eileenmcnaughton
Copy link
Contributor

thanks @alifrumin @vinuvarshith !

@eileenmcnaughton eileenmcnaughton merged commit aa31a7a into civicrm:master Dec 15, 2018
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.

3 participants