Commit cfb858c3 authored by mattwire's avatar mattwire
Browse files

Fix php notices on event template

parent c56962e2
......@@ -153,7 +153,7 @@ class CRM_AdvancedEvents_Form_Search extends CRM_Core_Form_Search {
$selector = new CRM_AdvancedEvents_Selector_Search($this->_queryParams, $this->_limit);
$selector->query();
$this->assign('rows', $selector->_rows);
$this->assign('rows', $selector->getRowsArray());
$selector->setKey($this->controller->_key);
......
......@@ -89,6 +89,13 @@ class CRM_AdvancedEvents_Selector_Search extends CRM_Core_Selector_Base implemen
*/
protected $_query;
/**
* Array of "rows"
*
* @var array
*/
protected $_rows;
/**
* Class constructor.
*
......@@ -184,7 +191,7 @@ class CRM_AdvancedEvents_Selector_Search extends CRM_Core_Selector_Base implemen
*/
public function getTotalCount($action) {
$this->query();
return count($this->_rows);
return $this->_rows ? count($this->_rows) : 0;
}
/**
......@@ -601,4 +608,13 @@ class CRM_AdvancedEvents_Selector_Search extends CRM_Core_Selector_Base implemen
return ts('CiviCRM Event Search');
}
/**
* Get the array of rows (without running a query first)
*
* @return array
*/
public function getRowsArray() {
return $this->_rows;
}
}
......@@ -68,8 +68,7 @@ class CRM_Event_Form_ManageEvent_Repeat extends CRM_Event_Form_ManageEvent {
$this->assign('summary', $this->get('summary'));
$this->assign('columnHeaders', $selector->getColumnHeaders());
$this->_rows = $selector->_rows;
$this->assign('rows', $this->_rows);
$this->assign('rows', $selector->getRowsArray());
$this->assign('context', 'Search');
$this->assign("{$prefix}single", $this->_single);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment