From 7b87841573341660c5e2ecadae4a0d6418323430 Mon Sep 17 00:00:00 2001 From: eileen Date: Tue, 9 Oct 2018 19:07:26 +0100 Subject: [PATCH] Fix payment hangs when registering a user for a paid event without recording payment This is an alternative to https://github.com/civicrm/civicrm-core/pull/12888 I wasn't actually able to reproduce the issue but this solution, proposed by Monish, seems safe & sensible --- CRM/Contribute/Form/Task/Status.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CRM/Contribute/Form/Task/Status.php b/CRM/Contribute/Form/Task/Status.php index ef89c4d9c940..790c5dc23370 100644 --- a/CRM/Contribute/Form/Task/Status.php +++ b/CRM/Contribute/Form/Task/Status.php @@ -305,11 +305,14 @@ public static function processForm($form, $params) { } /** - * @param $contributionIDs + * @param string $contributionIDs * * @return array */ public static function &getDetails($contributionIDs) { + if (empty($contributionIDs)) { + return []; + } $query = " SELECT c.id as contribution_id, c.contact_id as contact_id , @@ -326,7 +329,6 @@ public static function &getDetails($contributionIDs) { $dao = CRM_Core_DAO::executeQuery($query, CRM_Core_DAO::$_nullArray ); - $rows = array(); while ($dao->fetch()) { $rows[$dao->contribution_id]['component'] = $dao->participant_id ? 'event' : 'contribute';