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

Price forms fixes: part of CRM-19517 + cleanup & symptom fix for CRM-19953 #9763

Merged
merged 5 commits into from
Feb 2, 2017

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Feb 1, 2017

I pulled in a portion of @seamuslee001 PR for CRM-19517 - ie the part with the component check & making it editable. I made some changes to it

  • added a distinct into the component query
  • used the api rather than changing the BAO function. Ideally we would add a unit test to the api to enforce respect for 'check_permissions'
  • altered the edit form to load - I was still hitting a permission error there.

I didn't pull in all parts because I felt these changes stood alone and could go in without the rest. I had reservations about some of the other part I looked at because I saw the contribution forms were using a shared process to add price fields to the form & the event fields were using different methods & I felt they really needed to be consolidated.

This PR contains fix in a related area of code - basically tidy up around the getUsedFor function to

  • extract the chunks of code within the function & add comments
  • Remove call to the (sometimes slow) getUserFor from DeleteSet as delete set is only called in one place, which is right after the same call has been checked
  • only call getUsedFor from the api if 'return' has not been set. This fixes the immediate issue - ie. the contribution view page which calls that api with 'return' and can hit slowness

seamuslee001 and others added 5 commits February 2, 2017 10:35
Fix comments, spelling, unused variables
This does not change the functionality - it just improves readability and ensures that the slow part is marked and
future direction for the function is suggested
This function is only ever called from Price_Page_Set, which does not proceed to the price set delete
if there are price sets, so that call is redundant
Copy link
Contributor

@seamuslee001 seamuslee001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am going to approve this noting that there is still work to solve the display of the price sets. Eileen has indicated she wants to unify this. I have verified that fields / options with no active financial type do not show on public pages but are visible on the edit pages

@eileenmcnaughton
Copy link
Contributor Author

Merging per @seamuslee001 review (thank you)

@eileenmcnaughton eileenmcnaughton merged commit c7c6740 into civicrm:master Feb 2, 2017
@eileenmcnaughton eileenmcnaughton deleted the price_forms branch February 2, 2017 00:16
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