Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 667d571

Browse files
author
Michael Grauer
committed
BUG: refs #0326. Explicit casting, regardless of pdo database type.
1 parent 0293add commit 667d571

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

core/models/pdo/ItemModel.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -307,16 +307,11 @@ function delete($itemdao)
307307
$deleteType = array(MIDAS_FEED_CREATE_ITEM, MIDAS_FEED_CREATE_LINK_ITEM);
308308

309309

310-
$itemDaoKey = $itemdao->getKey();
311-
// postgres will not do the necessary type conversion
312-
if(Zend_Registry::get('configDatabase')->database->adapter == 'PDO_PGSQL')
313-
{
314-
$itemDaoKey = (string)$itemDaoKey;
315-
}
310+
// explicitly typecast the itemId to a string, for postgres
316311
$sql = $this->database->select()
317312
->setIntegrityCheck(false)
318313
->from(array('p' => 'feed'))
319-
->where('ressource = ?', $itemDaoKey);
314+
->where('ressource = ?', (string)$itemdao->getKey());
320315
$rowset = $this->database->fetchAll($sql);
321316
$this->ModelLoader = new MIDAS_ModelLoader();
322317
$feed_model = $this->ModelLoader->loadModel('Feed');

0 commit comments

Comments
 (0)