Skip to content

Commit bda4981

Browse files
RZivaralamdkd-kaehm
authored andcommitted
[BUGFIX] Use the return value of the UPDATE statement correctly in the LastSearchesRepository::update method
executeStatement() returns: * false → SQL execution failed (real error) * 0 → UPDATE executed successfully, but no data changed * 1+ → UPDATE executed and changed data Fixes: #4499
1 parent 4e7c8be commit bda4981

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Domain/Search/LastSearches/LastSearchesRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ protected function update(array $lastSearchesRow): void
139139
->set('keywords', $lastSearchesRow['keywords'])
140140
->executeStatement();
141141

142-
if ($affectedRows < 1) {
142+
if ($affectedRows === false) {
143143
throw new InvalidArgumentException(vsprintf('By trying to update last searches row with values "%s" nothing was updated, make sure the given "sequence_id" exists in database.', [json_encode($lastSearchesRow)]), 1502717923);
144144
}
145145
}

0 commit comments

Comments
 (0)