-
-
Notifications
You must be signed in to change notification settings - Fork 824
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
CRM-21031 Fix for id instead of financialtype name #10823
CRM-21031 Fix for id instead of financialtype name #10823
Conversation
mattwire
commented
Aug 6, 2017
•
edited by civicrm-builder
Loading
edited by civicrm-builder
- CRM-21031: Financial type ID display instead of label in "View Price Options"
Seems sensible & safe as it only affects a browse page @seamuslee001 - does this tie in at all with your work on disabled financial types & do you have any comment? |
So this will have the issue of as far as i can tell returning blank value i.e. NULL if the Financial Type that is used by a price option is disabled (I believe that is the default of CRM_Utils_Array::value). This is because https://github.com/civicrm/civicrm-core/blob/master/CRM/Contribute/PseudoConstant.php#L110. Now in this case that might make sense given that the FT isn't really active and therefore shouldn't we be showing a difference. |
I would also add that this is an improvement as i can't see how $financialType is getting set at all in the browse() function |
Ok @seamuslee001 that seems like this is good to merge then. I think you could make a pretty good argument for blank for a disabled type (& an even better one for showing it highlighted in red with a strike through, but I won't hold out for that) |
@seamuslee001 @eileenmcnaughton I actually wanted to use CRM_Core_PseudoConstant::getKey but couldn't work out what params I needed for financial_type_id. |
CRM_Core_PseudoConstant::getKey('CRM_Contribution_BAO_Contribution', 'financial_type_id', $value) |
(ie. financial_type_id is a field on the contribution BAO/DAO |
@eileenmcnaughton So that's what I actually thought it should be, but that doesn't return a value: This works: |
Hmm - OK so I got that wrong, there are 3 functions so, depending on whether you wanted the unique name or the label one of the latter 2 should work |