specify used variable in php closure
authorAndrew Engelbrecht <sudoman@ninthfloor.org>
Fri, 6 Jan 2017 19:59:23 +0000 (14:59 -0500)
committerAndrew Engelbrecht <sudoman@ninthfloor.org>
Fri, 6 Jan 2017 19:59:23 +0000 (14:59 -0500)
this resolves an issue with a recent change that introduced an anonymous
function with a closure. the used variable must be specified in the
funciton definition.

memberdashboard.php

index e795746fc59171fe7a54e6e464dd3fa3a2b71f9c..f37cb4508124631e61712b045a1ac6e83024d02f 100644 (file)
@@ -126,7 +126,7 @@ function memberdashboard_civicrm_post($op, $objectName, $objectId, &$objectRef)
       // organization's sake.
 
       // Get the oldest join date for the contact's memberships.
-      $getDao = function () {
+      $getDao = function () use ($objectRef) {
 
           $contactId = $objectRef->contact_id;
           $dao = CRM_Core_DAO::executeQuery(