Dependency Graph

Dependency Graph
related to related to child of child of duplicate of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0010393mantisbtfeaturepublic2009-10-07 14:19
ReporterprabhuranganAssigned Todhx  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.0a3 
Target Version1.2.0rc2Fixed in Version1.2.0rc2 
Summary0010393: SQL error with "hide inactive filter" feature on manage_user_page.php
Description

Dear All,

In manage_user_page when I select the 'Hide Inactive' checkbox and click 'Apply Filter' i am facing this issue:

It is not showing the user after filter:

Error I faced:

APPLICATION ERROR 0000401

Database query failed. Error received from database was 0001064: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?) - TO_DAYS(last_visit) < '7')
ORDER BY username ASC LIMIT 0,50' at line 3 for the query: SELECT *
FROM mantis_user_table
WHERE (1 = 1) AND (TO_DAYS(?) - TO_DAYS(last_visit) < '7')
ORDER BY username ASC.

TagsNo tags attached.

Relationships

has duplicate 0010310 closeddhx 'Hide Inactive' filter on Manage Users page produces SQL error 

Activities

vboctor

vboctor

2009-06-26 12:18

manager   ~0022272

I've confirmed this on this bug tracker which is currently running 1.2.0rc1.

tcharron

tcharron

2009-07-31 12:46

reporter   ~0022639

Problem was due to the addition of paging support, etc.

Line 213 of manage_user_page.php has this:

            WHERE $t_where AND " . db_helper_compare_days(0,"last_visit","< $days_old") . "

Due to the changes of earlier patches, the parameter is no longer bound to the query earlier, as the comment on line 215 suggests. Replacing this with this line, which mirrors the change made to the count query before it, fixes the issue:

            WHERE $t_where AND " . db_helper_compare_days("" . db_now() . "","last_visit","< $days_old") . "
dhx

dhx

2009-08-07 00:31

reporter   ~0022685

Thanks for reporting the issue prabhurangan.

And thanks tcharron for the fix. I've applied it to the git master and backported it to the 1.2.x branch.

Related Changesets

MantisBT: master baa88a50

2009-08-07 00:29

dhx


Details Diff
Fix 0010393: SQL query error with hide inactive users filter

On manage_user_page there exists a "hide inactive users" filter that was
broken due to an invalid SQL query.

Thanks to prabhurangan for reporting this issue and tcharron for a
solution to the problem.
Affected Issues
0010393
mod - manage_user_page.php Diff File

MantisBT: master-1.2.x 34d3633a

2009-08-07 00:29

dhx


Details Diff
Fix 0010393: SQL query error with hide inactive users filter

On manage_user_page there exists a "hide inactive users" filter that was
broken due to an invalid SQL query.

Thanks to prabhurangan for reporting this issue and tcharron for a
solution to the problem.
Affected Issues
0010393
mod - manage_user_page.php Diff File