Relationship Graph

Relationship Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0035544mantisbtdb postgresqlpublic2025-03-14 19:10
Reporterjacek.nakoneczny Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product Version2.27.0 
Target Version2.28.0Fixed in Version2.28.0 
Summary0035544: Attempt to update the category in the “Edit Project Category” form results in an error
Description

Pressing the "Update Category" button in the "Edit Project Category" form (manage_proj_cat_edit_page.php) causes an error: "invalid input syntax for type integer: "FALSE" for query UPDATE mantis_category_table SET name=$1, user=$2, status=$3 WHERE id=$4".

Additional Information

My data is storage in PostgreSQL 13 database.
In the file core/category_api.php, I applied a workaround that eliminates the error:
line 244:

    # Keep existing status
    if( $p_status === null ) {
        $p_status = $t_old_category['status'];
    } else {
        $p_status = (int)$p_status;
    }
TagsNo tags attached.

Relationships

related to 0031017 closeddregad Allow disabling Categories 

Activities

dregad

dregad

2025-03-07 13:00

developer   ~0069959

I can reproduce the behavior.

This is because the underlying database column (category.status) is an integer, but since we currently only have 2 possible states we use a checkbox for the UI and treat it as boolean in the code (see MantisBT master 05c1639f).

The proper fix is to ensure we pass an int to category_update().

dregad

dregad

2025-03-07 13:02

developer   ~0069960

Regression introduced by 0031017

dregad

dregad

2025-03-07 13:19

developer   ~0069961

PR https://github.com/mantisbt/mantisbt/pull/2116

Related Changesets

MantisBT: master 0b9dd984

2025-03-07 13:17

dregad


Details Diff
Fix error when updating category on PostgreSQL

Updating a category results in APPLICATION ERROR 401
Database query failed. Error received from database was #-1:
ERROR: invalid input syntax for type integer: "FALSE"

This is due to internally handling the category's status as a boolean,
while the underlying database column is an integer.

Typecasting the Checkbox post variable to int prevents the problem.

Fixes 0035544
Affected Issues
0035544
mod - manage_proj_cat_update.php Diff File