Skip to content

Commit

Permalink
Php8.2 fixes in report addToDeveloperTab function
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Mar 12, 2023
1 parent 64a9d9d commit 609c295
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions CRM/Report/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,13 @@ class CRM_Report_Form extends CRM_Core_Form {
protected $_add2groupSupported = TRUE;
protected $_groups = NULL;
protected $_grandFlag = FALSE;
protected $_rowsFound = NULL;
protected $_rowsFound;

/**
* @var array
*/
protected $_selectAliases = [];
protected $_rollup = NULL;
protected $_rollup;

/**
* Table containing list of contact IDs within the group filter.
Expand Down Expand Up @@ -522,9 +526,8 @@ class CRM_Report_Form extends CRM_Core_Form {
*
* The sql in the report is stored in this variable in order to be returned to api & test calls.
*
* @var string
* @var array
*/

protected $sqlArray;

/**
Expand Down Expand Up @@ -686,7 +689,7 @@ public function preProcessCommon() {

$this->setOutputMode();

if ($this->_outputMode == 'copy') {
if ($this->_outputMode === 'copy') {
$this->_createNew = TRUE;
$this->_params = $this->_formValues;
$this->_params['view_mode'] = 'criteria';
Expand Down Expand Up @@ -1525,7 +1528,7 @@ public function addToDeveloperTab($sql) {
];

$this->assignTabs();
$this->sqlFormattedArray = [];
$sqlFormattedArray = [];
$this->sqlArray[] = $sql;
foreach ($this->sqlArray as $sql) {
foreach (['LEFT JOIN'] as $term) {
Expand All @@ -1534,8 +1537,8 @@ public function addToDeveloperTab($sql) {
foreach (['FROM', 'WHERE', 'GROUP BY', 'ORDER BY', 'LIMIT', ';'] as $term) {
$sql = str_replace($term, '<br><br>' . $term, ($sql ?? ''));
}
$this->sqlFormattedArray[] = $sql;
$this->assign('sql', implode(';<br><br><br><br>', $this->sqlFormattedArray));
$sqlFormattedArray = $sql;
$this->assign('sql', implode(';<br><br><br><br>', $sqlFormattedArray));
}
$this->assign('sqlModes', $sqlModes = CRM_Utils_SQL::getSqlModes());

Expand Down Expand Up @@ -3699,7 +3702,7 @@ public function limit($rowCount = NULL) {
$this->_limit = " LIMIT {$this->_offsetValue}, {$this->_limitValue} ";
}
else {
$this->_limit = " LIMIT " . $this->_limitValue;
$this->_limit = ' LIMIT ' . $this->_limitValue;
}
}
}
Expand Down Expand Up @@ -3990,8 +3993,8 @@ public function addCustomDataToColumns($addFields = TRUE, $permCustomGroupIds =
}
$customGroupWhere = '';
if (!empty($permCustomGroupIds)) {
$customGroupWhere = "cg.id IN (" . implode(',', $permCustomGroupIds) .
") AND";
$customGroupWhere = 'cg.id IN (' . implode(',', $permCustomGroupIds) .
') AND';
}
$sql = "
SELECT cg.table_name, cg.title, cg.extends, cf.id as cf_id, cf.label,
Expand Down Expand Up @@ -5359,7 +5362,7 @@ protected function addStatisticsToSelect($field, $tableName, $fieldName, $select
* @param string $tableName
* @param string $fieldName
* @param array $field
* @param string $select
* @param array $select
* @return array
*/
protected function addBasicFieldToSelect($tableName, $fieldName, $field, $select) {
Expand Down

0 comments on commit 609c295

Please sign in to comment.