Giter Site home page Giter Site logo

biz.jmaconsulting.grantapplications's Introduction

biz.jmaconsulting.grantapplications's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

biz.jmaconsulting.grantapplications's Issues

Error on Contact Dashboard when Grant Applications enabled

I am newly updated to CiviCRM 5.4.1, and the most recent Grant Applications release.

When I try and access the Contact Dashboard at https://domain.org/civicrm/user?reset=1
I get this error:

Fatal error: Call to a member function getTemplateFileName() on null in /home/crm/public_html/sites/all/ext/biz.jmaconsulting.grantapplications/grantapplications.php on line 365

I think this existed prior to my upgrade as well, we just didn't expose the dashboard to contacts. I seem to remember seeing it when we were considering the dashboard previously.

integer and numeric numeric custom fields incorrectly assumed to be monetary

There are a few issues related to integer and numeric custom fields. To reproduce, create an integer and numeric custom field and expose via a profile on a grant application.

Honestly, I would probably just alter the code in Main.php to just condition on Money type fields, then then simplify the code downstream on both the Main.tpl and Confirm.php files. Only Money type fields should be treated as such.

Grant custom fields not rendered properly in receipt email

If custom fields belonging to the grant entity are included in the profile, they do not show correctly in the receipt email.

For example, a set of Note fields display as "custom_NNN" for the field name and "Array" for the value.

image

Suspect this has something to do with the way that core handles custom fields in CRM_Core_BAO_UFGroup::getValues().

Rich Text Editor field values displayed as escaped HTML source on confirmation page

When I add a custom field with Rich Text Editor input to a profile used on the grant application page, on the preview/confirmation page (i.e. before submitting), the text gets displayed as escaped HTML (e.g. "<p>the text</p>"), per the following screenshot:
screenshot from 2016-10-10 10 16 25

I would expect the HTML to be filtered for security, but for allowed HTML tags from the editor to be used instead of escaped.

Email not included in thank-you page

If a grant is submitted without any "On Behalf" information, the email is not included in the thank you message:

An email receipt has also been sent to .

Having looked in the code, the reason for this is unclear.

Wordpress unable to edit grant application

I had previously been able to edit a grant application in WP. Now trying the popup hangs. I see on the console an error:
"Uncaught Cannot guess entity name for field_type=Grant" in wp-content/plugins/civicrm/civicrm/js/model/crm.uf.js
I naively added a hack to the "hack" by adding:
case 'Grant':
return 'grant_1';
and now it seems to work
Poor "Grant" entity, seems to be the abandoned stepchild :)

  /**
   * This function is a hack for generating simulated values of "entity_name"
   * in the form-field model.
   *
   * @param {string} field_type
   * @return {string}
   */
  CRM.UF.guessEntityName = function(field_type) {
    switch (field_type) {
      case 'Contact':
      case 'Individual':
      case 'Organization':
      case 'Household':
        return 'contact_1';
      case 'Activity':
        return 'activity_1';
      case 'Contribution':
        return 'contribution_1';
      case 'Membership':
        return 'membership_1';
      case 'Participant':
        return 'participant_1';
      case 'Case':
        return 'case_1';
      default:
        if (!$.isEmptyObject(CRM.contactSubTypes) && ($.inArray(field_type,CRM.contactSubTypes) > -1)) {
          return 'contact_1';
        }
        else {
          throw "Cannot guess entity name for field_type=" + field_type;
        }
    }
  };

grantapplications installation error

** * This extension enhances profile creation for Grants. * * * Copyright (C) 2012 JMA Consulting * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Affero General Public License for more details. * * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see <http://[email protected] * JMA Consulting * 215 Spadina Ave, Ste 400 * Toronto, ON * Canada M5T 2C7 */ -- -- Table structure for table civicrm_grant_app_page CREATE TABLE IF NOT EXISTS `civicrm_grant_app_p in /home/finagbsr/fedgrantagency.accountant/wp-content/plugins/civicrm/civicrm/CRM/Utils/File.php on line 320

Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or service provider with more details about what action you were performing when this occurred.
Could not find the SQL file.

am running
CiviCRM version 4.7.24
PHP version 5.6.31
and the latest version of wordpress

please how do i fix this

Issue with installing and Uninstalling

Drupal Version 9.1.4
CiviCRM: 5.34.0

On installing - screen goes blank
(can hit back) and comes up as installed
Database Updated Needed - click this it errors with:

[Error: Upgrade biz.jmaconsulting.grantapplications to revision 4301]
DB Error: unknown error
Can be disabled
On attempting to uninstall - screen blank

Thanks and Kind Regards,

Beanie.

#2 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-1, 16, (Array:2), "ALTER TABLE civicrm_grant_app_pageADDis_draftTINYINT(4) DEFAULT NULL ...") #3 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -1, 16, (Array:2), "ALTER TABLE civicrm_grant_app_pageADDis_draftTINYINT(4) DEFAULT NULL ...", "DB_Error", TRUE) #4 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7)) #5 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-1, NULL, NULL, "ALTER TABLE civicrm_grant_app_pageADDis_draftTINYINT(4) DEFAULT NULL ...", "1060 ** Duplicate column name 'is_draft'") #6 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError() #7 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("ALTER TABLE civicrm_grant_app_pageADDis_draftTINYINT(4) DEFAULT NULL ...") #8 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Utils/File.php(348): DB_common->query("ALTER TABLEcivicrm_grant_app_pageADDis_draftTINYINT(4) DEFAULT NULL ...") #9 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Utils/File.php(310): CRM_Utils_File::runSqlQuerycoronaun_mumreg3?new_li...", "ALTER TABLE civicrm_grant_app_pageADDis_draft TINYINT(4) DEFAULT NULL ...", NULL, TRUE) #10 /home/coronaun/myukmanifesto.uk/workflow/registry3/sites/default/files/civicrm/ext/biz.jmaconsulting.grantapplications/CRM/Grantapplications/Upgrader/Base.php(128): CRM_Utils_File::s?new_lin...", "/home/coronaun/myukmanifesto.uk/workflow/registry3/sites/default/files/civicr...") #11 /home/coronaun/myukmanifesto.uk/workflow/registry3/sites/default/files/civicrm/ext/biz.jmaconsulting.grantapplications/CRM/Grantapplications/Upgrader.php(62): CRM_Grantapplications_Upgrader_Base->executeSqlFile("sql/upgrade_4301.sql") #12 /home/coronaun/myukmanifesto.uk/workflow/registry3/sites/default/files/civicrm/ext/biz.jmaconsulting.grantapplications/CRM/Grantapplications/Upgrader/Base.php(75): CRM_Grantapplications_Upgrader->upgrade_4301() #13 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Queue/Task.php(74): CRM_Grantapplications_Upgrader_Base::_queueAdapter(Object(CRM_Queue_TaskContext), "upgrade_4301") #14 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Queue/Runner.php(202): CRM_Queue_Task->run(Object(CRM_Queue_TaskContext)) #15 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Queue/Page/AJAX.php(36): CRM_Queue_Runner->runNext(TRUE) #16 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Queue/ErrorPolicy.php(90): CRM_Queue_Page_AJAX::{closure}() #17 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Queue/Page/AJAX.php(38): CRM_Queue_ErrorPolicy->call(Object(Closure)) #18 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(278): CRM_Queue_Page_AJAX::runNext() #19 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:13)) #20 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/civicrm/civicrm-core/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:4)) #21 /home/coronaun/myukmanifesto.uk/workflow/registry3/modules/contrib/civicrm/src/Civicrm.php(88): CRM_Core_Invoke::invoke((Array:4)) #22 /home/coronaun/myukmanifesto.uk/workflow/registry3/modules/contrib/civicrm/src/Controller/CivicrmController.php(80): Drupal\civicrm\Civicrm->invoke((Array:4)) #23 [internal function](): Drupal\civicrm\Controller\CivicrmController->main((Array:4), "queue:ajax:runNext") #24 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(123): call_user_func_array((Array:2), (Array:2)) #25 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/lib/Drupal/Core/Render/Renderer.php(573): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #26 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(124): Drupal\Core\Render\Renderer->executeInRenderContext(Object(Drupal\Core\Render\RenderContext), Object(Closure)) #27 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/lib/Drupal/Core/EventSubscriber/EarlyRenderingControllerWrapperSubscriber.php(97): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext((Array:2), (Array:2)) #28 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/symfony/http-kernel/HttpKernel.php(158): Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() #29 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/symfony/http-kernel/HttpKernel.php(80): Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request), 1) #30 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/lib/Drupal/Core/StackMiddleware/Session.php(57): Symfony\Component\HttpKernel\HttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE) #31 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/lib/Drupal/Core/StackMiddleware/KernelPreHandle.php(47): Drupal\Core\StackMiddleware\Session->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE) #32 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/modules/page_cache/src/StackMiddleware/PageCache.php(106): Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE) #33 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/modules/page_cache/src/StackMiddleware/PageCache.php(85): Drupal\page_cache\StackMiddleware\PageCache->pass(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE) #34 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/lib/Drupal/Core/StackMiddleware/ReverseProxyMiddleware.php(47): Drupal\page_cache\StackMiddleware\PageCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE) #35 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/lib/Drupal/Core/StackMiddleware/NegotiationMiddleware.php(52): Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE) #36 /home/coronaun/myukmanifesto.uk/workflow/registry3/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE) #37 /home/coronaun/myukmanifesto.uk/workflow/registry3/core/lib/Drupal/Core/DrupalKernel.php(706): Stack\StackedHttpKernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, TRUE) #38 /home/coronaun/myukmanifesto.uk/workflow/registry3/index.php(19): Drupal\Core\DrupalKernel->handle(Object(Symfony\Component\HttpFoundation\Request)) #39 {main}

Extension breaks formatting / layout of profile editor page

When extension is enabled, the tabbed layout of the CiviCRM Profiles page is broken.

This is because the extension overrides CRM_UF_Page_Group and CRM_UF_Page_ProfileEditor, but the bundled files are out-of-date.

CRM_UF_Page_Group is missing the following section at line 365 of civicrm-core/CRM/UF/Page/Group.php:

    Civi::resources()
      ->addScriptFile('civicrm', 'templates/CRM/common/TabHeader.js', 1, 'html-header')
      ->addSetting([
        'tabSettings' => ['active' => $_GET['selectedChild'] ?? NULL],
      ]);

This file needs to be updated to the latest version, but it would be better if a long-term solution could be found that doesn't involve replacing one of the core files. Possibly one of:

  • Make grant_type a pseudoconstant and update core version accordingly (would need agreement from core maintainers).
  • Use a template hook to populate just the specific part of the table, leaving the rest of the page as default.

It is no longer necessary to override CRM_UF_Page_ProfileEditor as the core version now includes support for other entities by pattern matching (see line 194 of civicrm-core/CRM/UF/Page/ProfileEditor.php):

        default:
          if (strpos($entityType, 'Model') !== FALSE) {
            $entity = str_replace('Model', '', $entityType);
            $backboneModel = self::convertCiviModelToBackboneModel(
              $entity,
              ts('%1', [1 => $entity]),
              $availableFields
            );
            if (!empty($backboneModel['schema'])) {
              $civiSchema[$entityType] = $backboneModel;
            }
          }
          if (!isset($civiSchema[$entityType])) {
            throw new CRM_Core_Exception("Unrecognized entity type: $entityType");
          }

Suggest that this file be removed from the extension.

The purpose of the override of CRM/Core/Page/AJAX/Location.php (adding "File" to the list of options when calculating field defaults) is unclear? This seems to be in-date, however.

Optional On Behalf Organisation not handled correctly

If no On Behalf Organisation information is entered, when it is optional to do so, the form is processed as if a null organisation has been entered, erroneously creating an organisation with empty details and overwriting the contact's existing "current employer" field.

This seems to be due to an error on line 530 of CRM/Grant/Form/Grant/Confirm.php:

 if (isset($this->_values['onbehalf_profile_id']) && isset($behalfOrganization['organization_name'])) {

Should be:

 if (!empty($this->_values['onbehalf_profile_id']) && !empty($behalfOrganization['organization_name'])) {

For consistency with surrounding code and application logic.

Registering a CiviEvent with this enabled on 5.20 gives WP 500 error

Hi,

The site is on Wordpress 5.3. PHP 7. CiviCRM 5.20. the extension version it's on is 1.6.1.
When attempting to sign up for an Event (event type: Training) and this extension is enabled in the background, the confirmation page of the event gives a 500 error "There has been a critical error on your website".

This all used to work before upgrading from 5.13.4. Please can you look into this.

Thanks.

Shohid

No grants visible on Contact Dashboard

From Dana:

If I save the grant it does save, but does not show on the User Dashboard. I did go enable the checkbox for it to appear and cleared the cache and still the grants I saved did not appear in my user/contact dashboard for me to ho back and edit. This was when I saved grant applications as an indvidual. When I added on behalf of org my contact dashboard went blank for the individual contact and did not display grants in the organization contact dashboard.

extension needs to be updated to include fixes in CRM-17022

When the extension is enabled, searching for grants with a filter for grant type, causes a DB error.
See stack trace below.
The fix for this is in the latest version of CiviCRM:
https://issues.civicrm.org/jira/browse/CRM-17022

#0 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(360): CRM_Core_Error::backtrace()
#1 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Utils/Type.php(262): CRM_Core_Error::fatal("(1) is not of the type Integer")
#2 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(5207): CRM_Utils_Type::escape("(1)", "Integer")
#3 /data/www/website.org/wp-content/plugins/civicrm/custom_ext/biz.jmaconsulting.grantapplications-4.6/CRM/Grant/BAO/Query.php(216): CRM_Contact_BAO_Query::buildClause("civicrm_grant.grant_type_id", "IN", "(1)", "Integer")
#4 /data/www/website.org/wp-content/plugins/civicrm/custom_ext/biz.jmaconsulting.grantapplications-4.6/CRM/Grant/BAO/Query.php(115): CRM_Grant_BAO_Query::whereClauseSingle((Array:5), Object(CRM_Contact_BAO_Query))
#5 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Component.php(315): CRM_Grant_BAO_Query::where(Object(CRM_Contact_BAO_Query))
#6 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(1877): CRM_Core_Component::alterQuery(Object(CRM_Contact_BAO_Query), "where")
#7 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(499): CRM_Contact_BAO_Query->whereClause()
#8 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Contact/BAO/Query.php(461): CRM_Contact_BAO_Query->initialize()
#9 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Grant/Selector/Search.php(168): CRM_Contact_BAO_Query->__construct((Array:3), NULL, NULL, FALSE, FALSE, 128)
#10 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Grant/Form/Search.php(244): CRM_Grant_Selector_Search->__construct((Array:3), 1, NULL, FALSE, NULL, "search")
#11 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(345): CRM_Grant_Form_Search->postProcess()
#12 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Refresh.php(75): CRM_Core_Form->mainProcess()
#13 /data/www/website.org/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Refresh->perform(Object(CRM_Grant_Form_Search), "refresh")
#14 /data/www/website.org/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Grant_Form_Search), "refresh")
#15 /data/www/website.org/wp-content/plugins/civicrm/custom_ext/biz.jmaconsulting.grantapplications-4.6/CRM/Core/Controller.php(359): HTML_QuickForm_Page->handle("refresh")
#16 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:3), NULL)
#17 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14))
#18 /data/www/website.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
#19 /data/www/website.org/wp-content/plugins/civicrm/civicrm.php(1189): CRM_Core_Invoke::invoke((Array:3))
#20 [internal function](): CiviCRM_For_WordPress->invoke("")
#21 /data/www/website.org/wp-includes/plugin.php(503): call_user_func_array((Array:2), (Array:1))
#22 /data/www/website.org/wp-admin/admin.php(236): do_action("toplevel_page_CiviCRM")

Grant profile does not allow mixed types

I'm exploring the Grant functionality for an exploratory discussion with a potential client.

First, I Now understand the true value of this extension, not only does it create a page for Grants, but it also enables profiles to support Grant field types! Without it, you must assign grant fields to an individual or organization (which I may have to resort to...) This makes The extension indispensable for collecting grants online.

My problem is with mixing field Types on a profile form, I believe this has been addressed for some complex field mixing on profiles, but when I add a Grant field and individual or contact field I'm unable to create the Forum in WordPress (http://wiki.civicrm.org/confluence/display/CRM/Multiple-record+Custom+Data+Sets+in+Profiles)

The error is: "Profile search, view and edit are not supported for Profiles which include fields for more than one record type." I do not have view or search enabled. just trying to create.

I see this referenced here: https://issues.civicrm.org/jira/browse/CRM-4363

This means I can't ask for a first and last name, and birthday.

** A possible workaround for this is to support an arbitrary number of profiles **(I see just 2 supported) like with Event registration.

Is this a limitation of the extension or am I doing something wrong?

RichTextEditor fields not recognized as filled in

After updating to version 1.6, I was unable to submit a grant application that had required RichTextEditor fields. Even though I had filled in those fields, it still gave a notice that those fields were required and would not let me submit it.

To solve the problem, I replaced definition of grantapplications_civicrm_validate in grantapplication.php with grantapplications_civicrm_validateForm, in the same way as the update made here 0d3cb72#diff-38b9550d82e5ed89505dcf714e4e78e9. I can now submit the form.

Can we get that update, as well as any other changes from the 4.7 branch, merged with the current branch?

Custom field data won't save on Profile in Grant Application Page

I've created a Set of Custom Fields for Grants. I can save entries to custom fields successfully when creating a new Grant through the WordPress/CiviCRM backend. But not through my Grant Application Page.

I've created a Grant Application page, using three Profiles. One for the "submit on behalf of an organization", one with additional fields on the applicant (individual contact), and one profile with the Grant custom fields.

When viewing the review or confirmation pages on the grant application, I can see the data I've entered into all the fields, including the grant custom fields:
Confirmation Page:
screenshot from 2016-10-04 08 07 32

However, data on the custom fields on the grants isn't saved in the system. Data on the other profiles is saved, and data in the Grant Profile I've created mapping to core CiviGrant fields is saved (e.g. amount requested), but the data from that same Grant profile pertaining to custom fields on the grants isn't saved.

In the email receipt, the data is all displayed as "Array":
Email Receipt:
screenshot from 2016-10-04 08 05 32

(Note: that the value for amount_requested is saved properly in the system, even though it says "Array" in the email receipt.)

And in the system, it's blank:
Backend View of Custom Fields on Grant submitted through Grant Application Page:
screenshot from 2016-10-04 08 07 35

I can't tell if I've done something wrong or if there's a bug. The custom fields work fine when editing a grant in the backend, and the Grant Profile works fine on the Grant Application Page for non-custom fields on the Grant...

Email address not stored

I have a grant application page which takes the email address of the applicant. On the confirmation page, the email shows up properly. However, in the CRM, it gets stored as "1", rather than the actual email address. The confirmation email also attempts to send to 1@[mydomain.com].

The grant application sends two individual contact email addresses in $params, email-Primary and email-1, to createProfileContact from CiviCRM Core. https://github.com/civicrm/civicrm-core/blob/master/CRM/Contact/BAO/Contact.php. email-Primary contains the correct email address and email-1 comes from a hidden field whose default value is 1. Inside the profile contact creation, there is a re-formatting of the array that puts email-Primary and email-1 in the same place (formatProfileContactParams). Since email-Primary gets put in first, email-1 overrides it.

I made a quick fix by inserting the line $params['email-1'] = CRM_Utils_Array::value('email-Primary', $params); just before the call to createProfileContact.

I assume that there is a better way to fix the problem, perhaps by removing email-1? Why is email-1 there in the first place? Or maybe formatProfileContactParams isn't doing the correct thing?

WordPress: 4.9.8
CiviCRM: 5.2.2
Grant Applications: 1.6.1

Feature Request: Allow grant profile for search results

Advanced search allows you to specify result columns using profiles. This extension will let you create grant profiles. it will not let you create search or search result type profiles for grant fields.

The use case for this is:

  1. Grant application requires collecting several things to complete.
  2. Created custom multi-select or checkbox fields for collecting info
  3. Want to create search results in advanced search which include custom fields.

Fatal error when used with logging

I have seen this before with extensions that use external database tables as the log table is not created properly. will try to disable/re-enable or create log manually.

Jun 30 08:14:56 [info] $backTrace = #0 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(235): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 internal function: CRM_Core_Error::handle(Object(DB_Error))
#2 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))
#3 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/DB.php(976): PEAR_Error->PEAR_Error("DB Error: no such table", -18, 16, (Array:2), "INSERT INTO civicrm_grant_app_page (title , intro_text , footer_text , grant_...")
#4 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-18, 16, (Array:2), "INSERT INTO civicrm_grant_app_page (title , intro_text , footer_text , grant_...")
#5 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -18, NULL, NULL, "INSERT INTO civicrm_grant_app_page (title , intro_text , footer_text , grant_...", "DB_Error", TRUE)
#6 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(899): DB_common->raiseError(-18, NULL, NULL, NULL, "1146 ** Table 'xxxxx_civi.log_civicrm_grant_app_page' doesn't exist")
#7 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(328): DB_mysql->mysqlRaiseError()
#8 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("INSERT INTO civicrm_grant_app_page (title , intro_text , footer_text , grant_...")
#9 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2442): DB_common->query("INSERT INTO civicrm_grant_app_page (title , intro_text , footer_text , grant_...")
#10 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1060): DB_DataObject->query("INSERT INTO civicrm_grant_app_page (title , intro_text , footer_text , grant...")
#11 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(450): DB_DataObject->insert()
#12 /home/xxxxx/public_html/wp-content/plugins/files/civicrm/extensions/biz.jmaconsulting.grantapplications/CRM/Grant/BAO/GrantApplicationPage.php(53): CRM_Core_DAO->save()
#13 /home/xxxxx/public_html/wp-content/plugins/files/civicrm/extensions/biz.jmaconsulting.grantapplications/CRM/Grant/Form/GrantPage/Settings.php(239): CRM_Grant_BAO_GrantApplicationPage::create((Array:20))
#14 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(345): CRM_Grant_Form_GrantPage_Settings->postProcess()
#15 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(164): CRM_Core_Form->mainProcess()
#16 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Grant_Form_GrantPage_Settings), "next", "Next")
#17 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Grant_Form_GrantPage_Settings), "next")
#18 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Grant_Form_GrantPage_Settings), "next")
#19 /home/xxxxx/public_html/wp-content/plugins/files/civicrm/extensions/biz.jmaconsulting.grantapplications/CRM/Core/Controller.php(359): HTML_QuickForm_Page->handle("next")
#20 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Core_Controller->run((Array:4), NULL)
#21 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:14))
#22 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:4))
#23 /home/xxxxx/public_html/wp-content/plugins/civicrm/civicrm.php(1189): CRM_Core_Invoke::invoke((Array:4))
#24 internal function: CiviCRM_For_WordPress->invoke("")
#25 /home/xxxxx/public_html/wp-includes/plugin.php(496): call_user_func_array((Array:2), (Array:1))
#26 /home/xxxxx/public_html/wp-admin/admin.php(226): do_action("toplevel_page_CiviCRM")

Grant Applications replaces all the default CiviCRM shortcodes instead of just adding the specific Grant Application shortcodes

Grant Applications replaces all the default CiviCRM shortcodes instead of just adding the specific Grant Application shortcodes. See file https://github.com/JMAConsulting/biz.jmaconsulting.grantapplications/blob/master/shortcode-wp/includes/civicrm.shortcodes.php

I think this PR on the Veda's GDPR extension demonstrates a different method to add a new WordPress shortcode, see veda-consulting-company/uk.co.vedaconsulting.gdpr#217

Shortcodes w Civi 5.0

I am not having success getting the shortcode recognized with Civi 5.13.6. It looks like some of the shortcode processing may have changed. Any thoughts would be appreciated. -Dave

Edit default amount on grant application page

The "Requested Amount" form field is not accessible on the grant application pages. Default amount value is printed to the screen, but no input form is available to change the default.

Change the error message and add help to field

  1. Could you change the error message so that it includes 'Create':

Error Message: "Cannot create, edit, search or view profiles with mixed record types."

  1. Could you find a good place to add the following help:

Help: "Mixing record types (other than contact, contact type (eg Individual), and contact custom subtype fields) is only supported in a component or extension that can manage the relationships between the types. Profiles Standalone, Create, Edit Search or View Mode cannot automatically create or find the related records. When profiles are used in components like Event or Contribution Pages they can support relevant mixed record types. For example, Event registration, could include participant and contacts fields because it includes the logic to associate them."

Compatibility issue with Civi 5.22.x?

A client just upgraded their Civi to 5.22.1, and accessing the Grants Dashboard yields this error:

Fatal error: Uncaught Error: Call to undefined method CRM_Grant_BAO_Query::getSearchFieldMetadata() in /www/www/wp-content/plugins/civicrm/civicrm/CRM/Grant/Form/Search.php:264 Stack trace: #0 //www/www/wp-content/plugins/civicrm/civicrm/CRM/Grant/Form/Search.php(273): CRM_Grant_Form_Search->getEntityMetadata() #1 /www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Form/Search.php(578): CRM_Grant_Form_Search->setSearchMetadata() #2 /www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Form/Search.php(127): CRM_Core_Form_Search->handleForcedSearch() #3 /www/www/wp-content/plugins/civicrm/civicrm/CRM/Grant/Form/Search.php(81): CRM_Core_Form_Search->preProcess() #4 /www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(574): CRM_Grant_Form_Search->preProcess() #5 /www/www/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Display.php(76): CRM_Core_Form->buildForm() #6 /www/www/wp-content/plugins/civ in /www/www/wp-content/plugins/civicrm/civicrm/CRM/Grant/Form/Search.php on line 264

If the extension is disabled, the dashboard functions correctly. (Interestingly, disabling the extension also disables the CiviGrant component entirely.) I notice that this extension hasn't been updated in a couple of years; are there plans to update it soon to work with the latest versions of CiviCRM?

PayPal IPN

We have an event page that takes payments that are then confirmed by PayPal via IPN.
When the IPN comes back, somehow the grant applications extension gets involved while it is loading the profile for the event registration. This leads to a fatal error, and the email confirmation for the payment is never sent by Civi.

Jul 06 20:39:05  [info] Contribution record updated successfully

Jul 06 20:39:05  [info] $Fatal Error Details = Array
(
    [message] => The requested Profile (gid=17) is disabled OR it is not configured to be used for 'Profile' listings in its Settings OR there is no Profile with that ID OR you do not have permission to access this profile. Please contact the site administrator if you need assistance.
    [code] =>
)


Jul 06 20:39:05  [info] $backTrace = #0 /data/www/example.org/wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(363): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /data/www/example.org/wp/wp-content/plugins/civicrm/custom_ext/biz.jmaconsulting.grantapplications-1.4.1/CRM/Core/BAO/UFGroup.php(356): CRM_Core_Error::fatal("The requested Profile (gid=17) is disabled OR it is not configured to be used...")
#2 /data/www/example.org/wp/wp-content/plugins/civicrm/civicrm/CRM/Event/BAO/Event.php(1304): CRM_Core_BAO_UFGroup::getFields("17", FALSE, 4, NULL, NULL, FALSE, NULL, FALSE, NULL, 4, "field_name", TRUE)
#3 /data/www/example.org/wp/wp-content/plugins/civicrm/civicrm/CRM/Event/BAO/Event.php(1146): CRM_Event_BAO_Event::buildCustomDisplay("17", "customPre", "15176", Object(CRM_Core_Smarty), "4831", NULL, NULL, (Array:0))
#4 /data/www/example.org/wp/wp-content/plugins/civicrm/civicrm/CRM/Contribute/BAO/Contribution.php(2221): CRM_Event_BAO_Event::sendMail("15176", (Array:9), "4831", NULL, FALSE)
#5 /data/www/example.org/wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/BaseIPN.php(853): CRM_Contribute_BAO_Contribution->composeMessageArray((Array:31), (Array:6), (Array:9), FALSE, FALSE)
#6 /data/www/example.org/wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/BaseIPN.php(788): CRM_Core_Payment_BaseIPN->sendMail((Array:31), (Array:6), (Array:8), (Array:9), FALSE, FALSE)
#7 /data/www/example.org/wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalIPN.php(290): CRM_Core_Payment_BaseIPN->completeTransaction((Array:31), (Array:6), (Array:8), Object(CRM_Core_Transaction), FALSE)
#8 /data/www/example.org/wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Payment/PayPalIPN.php(347): CRM_Core_Payment_PayPalIPN->single((Array:31), (Array:6), (Array:8), FALSE, FALSE)
#9 /data/www/example.org/wp/wp-content/plugins/civicrm/civicrm/extern/ipn.php(52): CRM_Core_Payment_PayPalIPN->main()
#10 {main}

Looking at the code in the referenced UFGroup.php at line 325, it looks like $skipPermission should be set to avoid checks during registration or when using profiles for anonymous users, but that is not implemented in the function.

    // add permissioning for profiles only if not registration
    if (!$skipPermission) {

missing email value in Thank You

On our Grant Application Thank You pages, we are getting this message:

Your grant application has been sent for processing. Please print this page for your records.
An email receipt has also been sent to .

There is no email address included at the end. The template shows that the value would be $email.

Both the logged in user and the person designated as a cc in the configuration are getting the receipts, so the issue seems to be limited to displaying the value in the template.

Using Grant profiles to search

We are using this extension to collect grant applications. Very helpful.

We would like to build a UI that allows evaluators to search/view applications using profiles. The grant applications use custom fields created for Grants. However when I attempt to bring up a profile to search - as I would other profiles - I get this error:

Profile search, view and edit are not supported for Profiles which include fields for more than one record type.

All of the fields in the profile are Grant fields. No others.

This is in "profile listings mode". the URL is /civicrm/profile?gid=59&reset=1

Is this a configuration issue, bug, or something that's not supported?

New Grant Application Page forwards to generic CiviCRM Administration Page

I was unable to install the Grants Application extension automatically, so I manually installed it. Everything acts as though it's installed correctly. However, when I try to access the New Grant Application Page, instead I get the generic CiviCRM Admin page.

extension page
new grant page

Thanks for your prompt reply, as I'm very eager to begin using your extension!

WordPress enables use of Mixed Profile for create

From another issue about profiles containing both grant and contact fields from @shawnholt:

There is something a bit off that threw me off.
Usually when you have a mixed / unsupported type, the create option goes away: http://screencast.com/t/xL3oDRHf5
but it didn't here for grants: http://screencast.com/t/u56Qgcoy .

Drupal the admin menu does work to remove for Grant: http://screencast.com/t/sVd0R3W8 to http://screencast.com/t/1VCob5bWUw

However in Wordpress it is not removed in the widget: http://screencast.com/t/UCmhXac7Au

Expose grant application page to anonymous users?

Does the grant application page extension have the ability to allow anonymous users to access and fill out a grant application page? A quick search did not turn up any instructions and a scan of the available permissions did not turn up anything useful. I'm using CiviCRM 4.6 with Drupal 7.

onbehalf of setting seems to be ignored

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?

Wordpress Shortcode not appearing

I have just recently installed this extension in a wordpress site however the short codes are not showing up / being recognized by WP. Are there any additional setup items that need to be done to be able to enable this?
Thank you for your help

Hide Grant amount

Feature Request
Some of our grants are of an open dollar amount to be decided by the judging committee.

Could there be a checkbox to hide the dollar amount on the application? Or simply hide it if the amount is 0.00?

Extension requires upgrade / refactoring for migration of CiviGrant to extension

CiviCRM 5.47 migrates CiviGrant from a component to a core extension. This extension needs to be updated to account for this change.

https://civicrm.org/blog/dev-team/civicrm-547-release

Haven't yet had time to extensively check compatibility, but one thing that is broken is the following on line 376 of grantapplications.php:

$userDashboard = $components['CiviGrant']->getUserDashboardObject();

The CiviGrant component no longer exists so this results in an error Call to a member function getUserDashboardObject() on null.

We do not use the grant user dashboard component in our use case so I have just commented this section out for now, pending a permanent fix.

Better subject for receipt email?

Enhancement request here.

We have a variety of "grants" we administer. All of the send a receipt (cc'ed to the manager) with the subject "Grants - Receipt". I don't see anywhere to change this.

Can this be altered so that it includes the title of of the grant? For example "Graduate Student Award - Applicaiton Receipt".

Failure to install on CiviCRM 4.7.22/Wordpress 4.8

When attempting to install the Grant Applications extension, I get the following error:

CRM_Exception: Could not find the SQL file. in /var/www/dearproject.org/wp-content/uploads/civicrm/ext/biz.jmaconsulting.grantapplications/CRM/Grantapplications/Upgrader/Base.php on line 259

I checked, and the sql files are indeed present, so I'm not sure where to go from here.

My system is a brand new install of:
PHP 7.0.19
MySQL 5.5
Apache 2.4.25
Wordpress 4.8
CiviCRM 4.7.22

Also installed are the extensions:
CiviMobile 2.0
Angular Profiles 4.6-1.0.2
CiviVolunteer 4.6-2.2.1

WP Shortcode Civi 4.7

I tested the latest version of this extension with WP 4.4.2 and CiviCRM 4.7.4 and it's working well on the CiviCRM parts. The only part I can't get to work is the shortcode. I checked permissions and they all seem to be correct for profile fields to be viewed. When I add a shortocde to a page and go there is says:

You do not have permission to access this content.

Even when logged in as site administrator. I can see and submit the application with the direct link from the CiviCRM Grant Application (Live) link in the Grants Dashboard.

Are there specific permissions needed or is there something else I am missing?

Update breadcrumb

On New Grant on dmaster, the breadcrumb shows CiviGrant Dashboard. That's good. On jma.staging.autismontario.com New Grant, the breadcrumb is not updated properly. Not sure if this due to Grant Applications all the time, or D8.

2018-09-24_13-19-17

WP Shortcode for 4.5

I was looking at what's in the shortcode-wp directory and noticing that the core file is using 4.4 not 4.5 civicrm.js file.

If I am understanding correctly, we are needing to replace for files for this to work in WP, is that correct? If so, what can be done to change it so core files are not needed to be replaced?

How to edit a draft version?

If I've submitted a draft application, how do I go back and finish it and submit it? I see no controls for doing so. Or am I misunderstanding the purpose of having a draft copy? I presumed it was to allow an applicant to complete part of the application now, and complete it later.

Upgrade from 1.7.0 to 1.7.1 fails

It's line 29 in biz.jmaconsulting.grantapplications/grantapplications.php. Because of how this SQL is run I can't see the whole SQL statement, but I can see that I'm getting an "already exists" error on one of the INSERT statements.

500 Error on Grants Dashboard after installing extension

hi guys,

Dev environment: - Wordpress 4.5.3, CiviCRM 4.6.19, grantapplications extension v 1.4.2

Once we install this extension the Grants dashboard breaks. I actually get a 500 error on this page: -
/wp-admin/admin.php?page=CiviCRM&q=civicrm/grant&reset=1

Can you help please.
Jon-man

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.