-
-
Notifications
You must be signed in to change notification settings - Fork 825
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
Fix CRM-20488: remove restrictions on soft credit contact type. #10419
Fix CRM-20488: remove restrictions on soft credit contact type. #10419
Conversation
Removing "WIP" prefix now that all checks have passed. @jitendrapurohit and @monishdeb, this is related (indirectly at least) to work by you in CRM-18102 and CRM-13981. Are you able to comment or review? |
// which will be used to constraint soft-credit contact type in formRule, CRM-13981 | ||
if (!empty($profileId[0]) && !empty($profileId[2])) { | ||
$form->_honoreeProfileType = CRM_Core_BAO_UFGroup::getContactType($profileId[0]); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you remove this part, I think we don't have any purpose to have preProcess() here as it seems this function was only used to set _honoreeProfileType
in $form
. Can we remove preProcess() from this file then ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good point. Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Further,
-
I think we should also remove any reference to this preProcess() to avoid any fatal errors caused by this change - one I can see is here.
-
Remove definition of
_honoreeProfileType
as it doesn't seem to be used elsewhere.jitendra$ grep -irn honoreeProfileType CRM CRM/Contribute/Form/Contribution.php:157: public $_honoreeProfileType;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure, I should have thought of that. Will get you something soon. Thanks!
621a529
to
8cf9d8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@twomice @jitendrapurohit I have made a minor fix i.e. removed the SC::preProcess(...)
call from codebase. And tested the patch, it works fine
@monishdeb worth removing unused var highlighted in point 2 of previous comment ? |
Oops, submitted a PR #10532 for that. Thanks |
works great! |
I'm going with the notion that the correct solution here is just to remove the limitation on contact type for soft credits.