MantisBT: master-1.2.x b8d4b503

Author Committer Branch Timestamp Parent
dregad dregad master-1.2.x 2012-05-24 05:21 master-1.2.x e48ce931
Affected Issues  0014288: Manage User not reachable due to error in PostgreSQL
 0014385: Impossible to create a new project with fresh install on PostgreSQL
Changeset

Fix PostgreSQL errors with boolean fields

PostgreSQL triggers an error when comparing a boolean field with an
integer value. This happens frequently in MantisBT as AdoDB stores
boolean fields as integers for most RDBMS.

This could prevent for example manage_user_page.php from loading.

To fix the problem, db_prepare_bool() has been modified to return 'true'
or 'false' as appropriate when the DB is PostgreSQL, through use of
AdoDB qstr() function. Behavior for other RDMBS is unchanged.

The where clause condition in manage_user_page.php has been modified to
use db_prepare_bool() instead of hardcoding 'enabled = 1'.

Following code cleanup was also performed:

  • Uses of db_prepare_bool() in filter_api.php and mc_api.php that
    would have caused incorrect behavior with the modified function have
    been removed
  • Removed non-existant 2nd parameter in call to db_prepare_bool() in
    filter_api.php
  • Fix whitespace in mc_api.php

Fixes 0014288

mod - api/soap/mc_api.php Diff File
mod - core/database_api.php Diff File
mod - core/filter_api.php Diff File
mod - manage_user_page.php Diff File