PayPal IPN
Created by: rpamfil
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) {