Fix payment hangs when registering a user for a paid event without recording payment
authoreileen <emcnaughton@wikimedia.org>
Tue, 9 Oct 2018 18:07:26 +0000 (19:07 +0100)
committereileen <emcnaughton@wikimedia.org>
Tue, 9 Oct 2018 18:07:26 +0000 (19:07 +0100)
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

index ef89c4d9c940f847b59b84cccf170db7dc039024..790c5dc23370be435562a446d5d649768ace5999 100644 (file)
@@ -305,11 +305,14 @@ AND    co.id IN ( $contribIDs )";
   }
 
   /**
-   * @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 @@ WHERE     c.id IN ( $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';