Merge pull request #6159 from yashodha/CRM-16735.fix
[civicrm-core.git] / CRM / Event / BAO / Event.php
index a6cfb6473891f274789f8403c9bd99d8821b6922..9a4f3d2aaf9b9c4e9fc296463ebffdb23d0e8f96 100644 (file)
@@ -1293,6 +1293,7 @@ WHERE civicrm_event.is_active = 1
       $profileIds = $id;
     }
 
+    $val = $groupTitles = NULL;
     foreach ($profileIds as $gid) {
       if (CRM_Core_BAO_UFGroup::filterUFGroups($gid, $cid)) {
         $values = array();
@@ -1707,7 +1708,7 @@ WHERE  id = $cfID
               $values[$index] = CRM_Utils_Date::customFormat(CRM_Utils_Date::format($params[$name]));
             }
             else {
-              $values[$index] = $params[$name];
+              $values[$index] = CRM_Utils_Array::value($name, $params);
             }
           }
         }
@@ -2029,7 +2030,7 @@ WHERE  ce.loc_block_id = $locBlockId";
         $permissions[CRM_Core_Permission::EDIT] = array_keys($allEvents);
       }
       else {
-        $permissions[CRM_Core_Permission::EDIT] = &CRM_ACL_API::group(CRM_Core_Permission::EDIT, NULL, 'civicrm_event', $allEvents, $createdEvents);
+        $permissions[CRM_Core_Permission::EDIT] = CRM_ACL_API::group(CRM_Core_Permission::EDIT, NULL, 'civicrm_event', $allEvents, $createdEvents);
       }
 
       if (CRM_Core_Permission::check('edit all events')) {
@@ -2044,7 +2045,7 @@ WHERE  ce.loc_block_id = $locBlockId";
           // at the same time also allow any hook to override if needed.
           $createdEvents = array_keys($allEvents);
         }
-        $permissions[CRM_Core_Permission::VIEW] = &CRM_ACL_API::group(CRM_Core_Permission::VIEW, NULL, 'civicrm_event', $allEvents, $createdEvents);
+        $permissions[CRM_Core_Permission::VIEW] = CRM_ACL_API::group(CRM_Core_Permission::VIEW, NULL, 'civicrm_event', $allEvents, $createdEvents);
       }
 
       $permissions[CRM_Core_Permission::DELETE] = array();