From 5ee135318f837614088166474def1cd768c3bcd8 Mon Sep 17 00:00:00 2001 From: Andrew Engelbrecht Date: Tue, 10 Jan 2017 15:58:55 -0500 Subject: [PATCH] expand the scope of the $contactId variable this variable is used elsewhere in the outer function, so it should not be limited to the lambda function. --- memberdashboard.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/memberdashboard.php b/memberdashboard.php index f37cb45..3cb0926 100644 --- a/memberdashboard.php +++ b/memberdashboard.php @@ -125,10 +125,11 @@ function memberdashboard_civicrm_post($op, $objectName, $objectId, &$objectRef) // TODO: Extract all of this to a class for clarity and // organization's sake. - // Get the oldest join date for the contact's memberships. - $getDao = function () use ($objectRef) { + $contactId = $objectRef->contact_id; - $contactId = $objectRef->contact_id; + $getDao = function () use ($contactId) { + + // Get the oldest join date for the contact's memberships. $dao = CRM_Core_DAO::executeQuery( 'SELECT join_date FROM civicrm_membership WHERE contact_id=%1 ORDER BY join_date ASC LIMIT 1', array( 1 => array($contactId, 'Integer') ) -- 2.25.1