From: jitendrapurohit Date: Mon, 9 May 2016 09:14:32 +0000 (+0530) Subject: CRM-18520 - replace row_count() with affectedRows() X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=c299571d889a9bd42182a98e2b9e043294d2865e;p=civicrm-core.git CRM-18520 - replace row_count() with affectedRows() minor fix --- diff --git a/CRM/Contact/Form/Task/Unhold.php b/CRM/Contact/Form/Task/Unhold.php index e9ee12d711..3da999ed31 100644 --- a/CRM/Contact/Form/Task/Unhold.php +++ b/CRM/Contact/Form/Task/Unhold.php @@ -23,18 +23,17 @@ class CRM_Contact_Form_Task_Unhold extends CRM_Contact_Form_Task { $queryString = " UPDATE civicrm_email SET on_hold = 0, hold_date = null WHERE on_hold = 1 AND hold_date is not null AND contact_id in (" . implode(",", $this->_contactIds) . ")"; - CRM_Core_DAO::executeQuery($queryString); - $sql = "SELECT ROW_COUNT( )"; - $result = CRM_Core_DAO::singleValueQuery($sql); - if ($result) { + $result = CRM_Core_DAO::executeQuery($queryString); + $rowCount = $result->affectedRows(); + + if ($rowCount) { CRM_Core_Session::setStatus(ts('%count email was found on hold and updated.', array( - 'count' => $result, + 'count' => $rowCount, 'plural' => '%count emails were found on hold and updated.', )), ts('Emails Restored'), 'success'); } else { CRM_Core_Session::setStatus(ts('The selected contact does not have an email on hold.', array( - 'count' => $result, 'plural' => 'None of the selected contacts have an email on hold.', )), ts('No Emails to Restore'), 'info'); }