Hi everyone

thanks for the quick tips in IRC (DEBUG and DEBUG_ARGS). All the foreach
warnings magically disappeared with an (array) cast, and I have managed to
solve an "Indetermineable data type" issue in prepared statements by
changing all (2) instances of

$pdo->prepare( $query )

to

$pdo->prepare( $query, array(PDO::ATTR_EMULATE_PREPARES => true) )

in *system/classes/databaseconnection.php
*
[is this something you'd be willing to consider? it basically prepares
statements at the pdo side, not the db server side, fixing incompatibilities
when preparing statements for different dbms targets. please have a look at
these links:

http://drupal.org/node/354139
http://www.semicomplete.com/blog/geekery/mysql-prepare-queries-not-cached.html

Now, the only thing that remains to be fixed for the admin pages when using
Postgresql seems to be the following error:

Warning: PDOStatement::execute() [pdostatement.execute]: SQLSTATE[42804]:
Datatype mismatch: 7 ERROR:  argument of AND must be type boolean, not type
integer in system/classes/databaseconnection.php line 288

system/classes/databaseconnection.php line 288:
 PDOStatement->execute(array (
    0 => 1,
    1 => 2,
    2 => 1,
  ))
system/classes/databaseconnection.php line 535:
 DatabaseConnection->query('
*  SELECT DISTINCT COUNT(1)
  FROM {posts}  WHERE ( ({posts}.status = ? AND {posts}.content_type = ? AND
{posts}.user_id = ?) ) AND (
  (1)
  ) LIMIT 5*',    array (
    0 => 1,
    1 => 2,
    2 => 1,
  ))
system/classes/db.php line 293:
 DatabaseConnection->get_value('
  SELECT DISTINCT COUNT(1)
  FROM {posts}  WHERE ( ({posts}.status = ? AND {posts}.content_type = ? AND
{posts}.user_id = ?) ) AND (
  (1)
  ) LIMIT 5',    array (
    0 => 1,
    1 => 2,
    2 => 1,
  ))
system/classes/posts.php line 573:
 DB::get_value('
  SELECT DISTINCT COUNT(1)
  FROM {posts}  WHERE ( ({posts}.status = ? AND {posts}.content_type = ? AND
{posts}.user_id = ?) ) AND (
  (1)
  ) LIMIT 5',    array (
    0 => 1,
    1 => 2,
    2 => 1,
  ),    'Post')
system/classes/adminhandler.php line 397:
 Posts::get(array (
    'count' => 1,
    'content_type' => 2,
    'status' => 1,
    'user_id' => 1,
  ))
system/classes/adminhandler.php line 125:
 AdminHandler->get_dashboard()
system/classes/actionhandler.php line 68:
 AdminHandler->act_admin()
system/classes/controller.php line 171:
 ActionHandler->act('admin')
index.php line 240:
 Controller::dispatch_request()


ints need to be cast to boolean if you intend to use them this way... What
does that *(1)* do there, anyway?
I'll have another look tomorrow.

cheers,

Michael

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/habari-dev
-~----------~----~----~----~------~----~------~--~---

Reply via email to