Skip to content

Commit

Permalink
Merge pull request #12064 from seamuslee001/nfc_rename_groupby_function
Browse files Browse the repository at this point in the history
Rename function enableFullGroupByMode to be reenableFullGroupByMode t…
  • Loading branch information
eileenmcnaughton authored May 1, 2018
2 parents f6a9dc2 + 2f68ef2 commit d4fc822
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions CRM/Core/DAO.php
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ public static function disableFullGroupByMode() {
}

/**
* Enables ONLY_FULL_GROUP_BY sql_mode as necessary..
* Re-enables ONLY_FULL_GROUP_BY sql_mode as necessary..
*/
public static function enableFullGroupByMode() {
public static function reenableFullGroupByMode() {
$currentModes = CRM_Utils_SQL::getSqlModes();
if (CRM_Utils_SQL::supportsFullGroupBy() && !in_array('ONLY_FULL_GROUP_BY', $currentModes) && CRM_Utils_SQL::isGroupByModeInDefault()) {
$currentModes[] = 'ONLY_FULL_GROUP_BY';
Expand Down
4 changes: 2 additions & 2 deletions CRM/Export/BAO/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -1007,11 +1007,11 @@ public static function exportComponents(
// delete the export temp table and component table
$sql = "DROP TABLE IF EXISTS {$exportTempTable}";
CRM_Core_DAO::executeQuery($sql);
CRM_Core_DAO::enableFullGroupByMode();
CRM_Core_DAO::reenableFullGroupByMode();
CRM_Utils_System::civiExit();
}
else {
CRM_Core_DAO::enableFullGroupByMode();
CRM_Core_DAO::reenableFullGroupByMode();
throw new CRM_Core_Exception(ts('No records to export'));
}
}
Expand Down
2 changes: 1 addition & 1 deletion CRM/Mailing/Event/BAO/TrackableURLOpen.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public static function &getRows(
}
CRM_Core_DAO::disableFullGroupByMode();
$dao->query($query);
CRM_Core_DAO::enableFullGroupByMode();
CRM_Core_DAO::reenableFullGroupByMode();
$results = array();

while ($dao->fetch()) {
Expand Down
2 changes: 1 addition & 1 deletion CRM/Report/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -2962,7 +2962,7 @@ public function buildRows($sql, &$rows) {
CRM_Core_DAO::disableFullGroupByMode();
}
$dao = CRM_Core_DAO::executeQuery($sql);
CRM_Core_DAO::enableFullGroupByMode();
CRM_Core_DAO::reenableFullGroupByMode();
if (!is_array($rows)) {
$rows = array();
}
Expand Down

0 comments on commit d4fc822

Please sign in to comment.