onbehalf of setting seems to be ignored
Created by: jmcclelland
We have a grant application page that is configured to both allow users to submit an application on behalf of an organization (is_organization) and we have selected the option to force this to happen (is_for_organization).
On the grant application page, the on behalf of profile is properly displayed, however, when submitted the information is ignored. The grant is assigned to the contact.
I fixed the problem with this change:
--- Confirm.php.orig 2018-09-12 14:38:25.360973714 -0400
+++ Confirm.php 2018-09-12 14:38:32.133038663 -0400
@@ -519,7 +519,7 @@
}
// If onbehalf-of-organization grant application add organization
// and it's location.
- if (isset($this->_values['onbehalf_profile_id']) && isset($behalfOrganization['organization_name']) && !empty($this->_params['is_for_organization'])) {
+ if (isset($this->_values['onbehalf_profile_id']) && isset($behalfOrganization['organization_name'])) {
$ufFields = array();
foreach ($this->_fields['onbehalf'] as $name => $value) {
$ufFields[$name] = 1;
Although I'm not entirely sure why is_for_organization is not set in the params (it is set in the _values array).
Any suggestions?