Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

BUGFIX Reset WHERE clause in SQLMap->getItem() to ensure it can be in…

…voked more than once
  • Loading branch information...
commit 55183ec386e494c65ea9146737ebaf77fe59a0d7 1 parent b438a0a
@chillu chillu authored
Showing with 3 additions and 1 deletion.
  1. +3 −1 model/SQLMap.php
View
4 model/SQLMap.php
@@ -38,8 +38,10 @@ public function __construct(SQLQuery $query, $keyField = "ID", $titleField = "Ti
public function getItem($id) {
if($id) {
$baseTable = reset($this->query->from);
- $this->query->where[] = "$baseTable.\"ID\" = $id";
+ $where = "$baseTable.\"ID\" = $id";
+ $this->query->where[sha1($where)] = $where;
$record = $this->query->execute()->first();
+ unset($this->query->where[sha1($where)]);
if($record) {
$className = $record['ClassName'];
$obj = new $className($record);
Please sign in to comment.
Something went wrong with that request. Please try again.