Skip to content
This repository has been archived by the owner on Jul 19, 2022. It is now read-only.

onbehalf of setting seems to be ignored #140

Closed
jmcclelland opened this issue Sep 12, 2018 · 5 comments
Closed

onbehalf of setting seems to be ignored #140

jmcclelland opened this issue Sep 12, 2018 · 5 comments

Comments

@jmcclelland
Copy link
Contributor

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?

@monishdeb
Copy link
Member

@jmcclelland thanks for notifying this issue. It might be the case that this was missed while doing 4.4 to 4.7 migration. Can you send a PR for that fix? and I'll will be happy to review and merge :)

jmcclelland added a commit to progressivetech/biz.jmaconsulting.grantapplications that referenced this issue Sep 12, 2018
@jmcclelland
Copy link
Contributor Author

Thanks for the quick feedback, PR submitted.

@monishdeb
Copy link
Member

Ok on basis of compare link I have created a PR #141 is there anything else you need to add/change? or this change in condition will fix this issue?

@jmcclelland
Copy link
Contributor Author

That looks great - thanks! And sorry, I didn't hit submit on my PR...

@monishdeb
Copy link
Member

No problem. I have merged the PR. closing this issue now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants