* [FIX] Solves #435. Wrong returning code when updating a record and data is the same stored. Thanks to @wernerreuser for the feedback.

This commit is contained in:
nuxsmin
2017-02-16 00:21:19 +01:00
parent 0c37e162b5
commit 6b2b07fddf
7 changed files with 6 additions and 30 deletions

View File

@@ -199,10 +199,6 @@ class Customer extends CustomerBase implements ItemInterface, ItemSelectInterfac
DB::getQuery($Data);
if ($Data->getQueryNumRows() === 0) {
throw new SPException(SPException::SP_INFO, __('Cliente no encontrado', false));
}
return $this;
}

View File

@@ -82,10 +82,10 @@ class Notice extends NoticeBase implements ItemInterface
*/
public function delete($id)
{
$query = 'DELETE FROM notices WHERE notice_id = ? AND BIN(notice_sticky) = 0 LIMIT 1';
if (Session::getUserData()->isUserIsAdminApp()) {
$query = 'DELETE FROM notices WHERE notice_id = ? LIMIT 1';
} else {
$query = 'DELETE FROM notices WHERE notice_id = ? AND BIN(notice_sticky) = 0 LIMIT 1';
}
$Data = new QueryData();
@@ -133,10 +133,6 @@ class Notice extends NoticeBase implements ItemInterface
DB::getQuery($Data);
if ($Data->getQueryNumRows() === 0) {
throw new SPException(SPException::SP_INFO, __('Notificación no encontrada', false));
}
return $this;
}

View File

@@ -116,10 +116,6 @@ class Plugin extends PluginBase implements ItemInterface
DB::getQuery($Data);
if ($Data->getQueryNumRows() === 0) {
throw new SPException(SPException::SP_INFO, __('Plugin no encontrado', false));
}
return $this;
}

View File

@@ -197,12 +197,10 @@ class Profile extends ProfileBase implements ItemInterface, ItemSelectInterface
DB::getQuery($Data);
if ($Data->getQueryNumRows() === 0) {
throw new SPException(SPException::SP_INFO, __('Perfil no encontrado', false));
if ($Data->getQueryNumRows() > 0) {
$this->updateSessionProfile();
}
$this->updateSessionProfile();
return $this;
}

View File

@@ -105,10 +105,6 @@ class PublicLink extends PublicLinkBase implements ItemInterface
DB::getQuery($Data);
if ($Data->getQueryNumRows() === 0) {
throw new SPException(SPException::SP_INFO, __('Enlace no encontrado', false));
}
return true;
}

View File

@@ -138,10 +138,6 @@ class Tag extends TagBase implements ItemInterface, ItemSelectInterface
DB::getQuery($Data);
if ($Data->getQueryNumRows() === 0) {
throw new SPException(SPException::SP_INFO, __('Etiqueta no encontrada', false));
}
return $this;
}

View File

@@ -184,12 +184,10 @@ class User extends UserBase implements ItemInterface, ItemSelectInterface
DB::getQuery($Data);
if ($Data->getQueryNumRows() === 0) {
throw new SPException(SPException::SP_INFO, __('Usuario no encontrado', false));
if ($Data->getQueryNumRows() > 0) {
$this->itemData->setUserId(DB::getLastId());
}
$this->itemData->setUserId(DB::getLastId());
return $this;
}