fix followup issues with unneeded parameters

This commit is contained in:
Morris Jobke 2015-04-18 17:02:39 +02:00
parent 47ecfd98a3
commit e837927ad5
5 changed files with 20 additions and 20 deletions

View file

@ -571,7 +571,7 @@ class Local {
$result = $query->execute($args);
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('files_sharing', \OC_DB::getErrorMessage($result), \OCP\Util::ERROR);
\OCP\Util::writeLog('files_sharing', \OC_DB::getErrorMessage(), \OCP\Util::ERROR);
return null;
}
if ($share = $result->fetchRow()) {

View file

@ -290,11 +290,11 @@ class OC_DB {
public static function raiseExceptionOnError($result, $message = null) {
if(self::isError($result)) {
if ($message === null) {
$message = self::getErrorMessage($result);
$message = self::getErrorMessage();
} else {
$message .= ', Root cause:' . self::getErrorMessage($result);
$message .= ', Root cause:' . self::getErrorMessage();
}
throw new \OC\DatabaseException($message, self::getErrorCode($result));
throw new \OC\DatabaseException($message, self::getErrorCode());
}
}

View file

@ -153,7 +153,7 @@ class Share extends \OC\Share\Constants {
$result = $query->execute(array($source, self::SHARE_TYPE_USER));
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OC_Log::ERROR);
} else {
while ($row = $result->fetchRow()) {
$shares[] = $row['share_with'];
@ -175,7 +175,7 @@ class Share extends \OC\Share\Constants {
$result = $query->execute(array($source, self::SHARE_TYPE_GROUP));
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OC_Log::ERROR);
} else {
while ($row = $result->fetchRow()) {
$usersInGroup = \OC_Group::usersInGroup($row['share_with']);
@ -199,7 +199,7 @@ class Share extends \OC\Share\Constants {
$result = $query->execute(array($source, self::SHARE_TYPE_LINK));
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OCP\Util::ERROR);
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OCP\Util::ERROR);
} else {
if ($result->fetchRow()) {
$publicShare = true;
@ -218,7 +218,7 @@ class Share extends \OC\Share\Constants {
$result = $query->execute(array($source, self::SHARE_TYPE_REMOTE));
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OCP\Util::ERROR);
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OCP\Util::ERROR);
} else {
if ($result->fetchRow()) {
$remoteShare = true;
@ -256,7 +256,7 @@ class Share extends \OC\Share\Constants {
$result = $query->execute();
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage($result), \OC_Log::ERROR);
\OCP\Util::writeLog('OCP\Share', \OC_DB::getErrorMessage(), \OC_Log::ERROR);
} else {
while ($row = $result->fetchRow()) {
foreach ($fileTargets[$row['fileid']] as $uid => $shareData) {
@ -447,7 +447,7 @@ class Share extends \OC\Share\Constants {
$query = \OC_DB::prepare('SELECT * FROM `*PREFIX*share` WHERE `token` = ?', 1);
$result = $query->execute(array($token));
if (\OC_DB::isError($result)) {
\OC_Log::write('OCP\Share', \OC_DB::getErrorMessage($result) . ', token=' . $token, \OC_Log::ERROR);
\OC_Log::write('OCP\Share', \OC_DB::getErrorMessage() . ', token=' . $token, \OC_Log::ERROR);
}
$row = $result->fetchRow();
if ($row === false) {
@ -1598,7 +1598,7 @@ class Share extends \OC\Share\Constants {
$result = $query->execute($queryArgs);
if (\OC_DB::isError($result)) {
\OC_Log::write('OCP\Share',
\OC_DB::getErrorMessage($result) . ', select=' . $select . ' where=',
\OC_DB::getErrorMessage() . ', select=' . $select . ' where=',
\OC_Log::ERROR);
}
$items = array();
@ -1662,7 +1662,7 @@ class Share extends \OC\Share\Constants {
$parentResult = $query->execute(array($row['parent']));
if (\OC_DB::isError($result)) {
\OC_Log::write('OCP\Share', 'Can\'t select parent: ' .
\OC_DB::getErrorMessage($result) . ', select=' . $select . ' where=' . $where,
\OC_DB::getErrorMessage() . ', select=' . $select . ' where=' . $where,
\OC_Log::ERROR);
} else {
$parentRow = $parentResult->fetchRow();

View file

@ -233,7 +233,7 @@ class Tags implements \OCP\ITags {
$entry = $entries[$objId][] = $row['category'];
}
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage($result), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
return false;
}
}
@ -283,7 +283,7 @@ class Tags implements \OCP\ITags {
$stmt = \OCP\DB::prepare($sql);
$result = $stmt->execute(array($tagId));
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage($result), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
return false;
}
} catch(\Exception $e) {
@ -510,7 +510,7 @@ class Tags implements \OCP\ITags {
. 'WHERE `uid` = ?');
$result = $stmt->execute(array($arguments['uid']));
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage($result), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
}
} catch(\Exception $e) {
\OCP\Util::writeLog('core', __METHOD__.', exception: '.$e->getMessage(),
@ -539,7 +539,7 @@ class Tags implements \OCP\ITags {
. 'WHERE `uid` = ?');
$result = $stmt->execute(array($arguments['uid']));
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('core', __METHOD__. ', DB error: ' . \OCP\DB::getErrorMessage($result), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. ', DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
}
} catch(\Exception $e) {
\OCP\Util::writeLog('core', __METHOD__ . ', exception: '
@ -567,7 +567,7 @@ class Tags implements \OCP\ITags {
$stmt = \OCP\DB::prepare($query);
$result = $stmt->execute($updates);
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage($result), \OCP\Util::ERROR);
\OCP\Util::writeLog('core', __METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(), \OCP\Util::ERROR);
return false;
}
} catch(\Exception $e) {
@ -725,7 +725,7 @@ class Tags implements \OCP\ITags {
$result = $stmt->execute(array($id));
if (\OCP\DB::isError($result)) {
\OCP\Util::writeLog('core',
__METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage($result),
__METHOD__. 'DB error: ' . \OCP\DB::getErrorMessage(),
\OCP\Util::ERROR);
return false;
}

View file

@ -200,7 +200,7 @@ class OC_User_Database extends OC_User_Backend implements \OCP\IUserBackend {
$result = $query->execute(array($uid));
if (OC_DB::isError($result)) {
OC_Log::write('core', OC_DB::getErrorMessage($result), OC_Log::ERROR);
OC_Log::write('core', OC_DB::getErrorMessage(), OC_Log::ERROR);
return false;
}
@ -268,7 +268,7 @@ class OC_User_Database extends OC_User_Backend implements \OCP\IUserBackend {
$query = OC_DB::prepare('SELECT COUNT(*) FROM `*PREFIX*users`');
$result = $query->execute();
if (OC_DB::isError($result)) {
OC_Log::write('core', OC_DB::getErrorMessage($result), OC_Log::ERROR);
OC_Log::write('core', OC_DB::getErrorMessage(), OC_Log::ERROR);
return false;
}
return $result->fetchOne();