View Issue Details

IDProjectCategoryView StatusLast Update
0013937mantisbtfilterspublic2014-12-08 00:34
ReporterdregadAssigned Todregad 
Status closedResolutionfixed 
Product Version1.2.8 
Target Version1.3.0-beta.1Fixed in Version1.3.0-beta.1 
Summary0013937: Versions and Categories from existing filter not preselected when editing it

While debugging 0013935, I noticed a flaw with the version filters: the current 1.2.x code (including 1.2.8) is not pre-selecting the values from the current filter in the list when updating it.

As per atrol's comment 0013937:0031290, the same problem exists for Categories.

Steps To Reproduce

Assume a version "V" exists

  • Define a filter on Product Version "V" and apply it
  • Update that filter by clicking on Product Version
  • Nothing is selected (Version "V" should be selected)
TagsNo tags attached.


related to 0013935 closeddregad Version based filtering not possible 
related to 0007995 closedzakman Confusion in product_version values due to string comparisons with == operator 
related to 0011124 closeddhx The 'sticky_issues' value stored in the mantis_filter_table is not always stored correctly. 




2012-02-22 04:38

developer   ~0031290

Last edited: 2012-02-22 04:38

View 2 revisions

Same wrong behaviour for field category (not for other enums)
Maybe the same cause.



2012-02-22 05:46

developer   ~0031291

It's quite possible.

I already have a fix for versions lined up, but was waiting for your feedback on 0013935 before pushing it as it's touching the same section of the code; I'll see if the same logic can be applied also for Categories.



2012-02-23 18:25

developer   ~0031306

The fix is here for now:

I did not push it to the main repo, because there is a problem when (one of) the selected version(s) is a string: in this case the value [any] always and incorrectly gets pre-selected. I believe this is due to a bug in check_selected() function as described here

I'll wait for dhx's feedback.



2012-02-24 05:22

reporter   ~0031308

Last edited: 2012-02-24 05:22

View 2 revisions

This very early commit from 5 September 2007 (referencing bug 0007995) is highly relevant as it is the last time check_selected() changed in a meaningful way:



2012-02-24 11:12

reporter   ~0031312

I just pushed some fixes to the master branch to solve this problem.

I'd appreciate if someone is able to double check my extensive testing to make sure I didn't miss anything.

The next step is to backport these patches to master-1.2.x (not an easy job unfortunately).



2012-02-24 11:42

developer   ~0031313

Many thanks dhx. You may go to bed now ;)

I will have a look and perform tests next week.

Will also evaluate whether it's worth back-porting to 1.2.x or not, based on complexity of your changes (15 files, wow !).



2012-02-27 09:37

developer   ~0031335

Keeping this one opened for now, until decision has been taken to backport to 1.2.x (or not).



2013-08-16 12:50

developer   ~0037893

Changed assignment. dhx will not contribute to this issue in near future.



2013-10-21 18:37

developer   ~0038324

With 1.3.x making good progress towards release, I see no reason to keep this as a target for 1.2.



2013-12-01 22:04

reporter   ~0038698




2013-12-01 22:05

reporter   ~0038743


Related Changesets

MantisBT: master 1f515b3a

2012-02-24 03:15:19


Details Diff
Fix 0013937: Filter dropdown values of [any], [none], etc not saved

Damien Regad <> and Roland Becker
<> reported an issue whereby filter dropdowns would
always select the meta filter option of [any] by default, even if the
active filter was set to another value.

The cause is incorrect logic within both the check_checked and
check_selected functions dating back to issue 0007995 in 2007.
Documentation has been added inline to the code to clarify how these
functions work and the gotcha to do with == vs. === comparisons.
mod - core/helper_api.php Diff File

MantisBT: master 79c04ca2

2012-02-24 08:02:29


Details Diff
Fix 0013937: Fix check_selected and check_checked functions

These functions were originally designed very loosely with respect to
input data types. This was causing problems in numerous areas where
strings were being compared with integers, etc.

Both functions have been modified such that an error will be generated
when the types are inconsistent. This will force developers to properly
consider the types of variables when coding with MantisBT, ensuring less
likelihood of bugs arising from "1.1"=="1.10", 0=="" comparisons, etc.

Most if not all elements of the UI with drop-down boxes, check boxes,
radio boxes and lists have been thoroughly tested after these changes.
The default state of these UI fields should once again match default
configuration values in config_inc.php, current values of the
field/filter, etc. This greatly improves the usability of the UI.
mod - account_prefs_inc.php Diff File
mod - bug_report_page.php Diff File
mod - bug_update_advanced_page.php Diff File
mod - core/filter_api.php Diff File
mod - core/helper_api.php Diff File
mod - core/html_api.php Diff File
mod - core/plugin_api.php Diff File
mod - core/print_api.php Diff File
mod - core/profile_api.php Diff File
mod - manage_custom_field_edit_page.php Diff File
mod - manage_proj_cat_edit_page.php Diff File
mod - manage_proj_edit_page.php Diff File
mod - manage_user_edit_page.php Diff File
mod - tag_update_page.php Diff File

Issue History

Date Modified Username Field Change
2012-02-21 19:03 dregad New Issue
2012-02-21 19:03 dregad Status new => assigned
2012-02-21 19:03 dregad Assigned To => dregad
2012-02-21 19:03 dregad Relationship added related to 0013935
2012-02-22 04:38 atrol Note Added: 0031290
2012-02-22 04:38 atrol Note Edited: 0031290 View Revisions
2012-02-22 05:46 dregad Note Added: 0031291
2012-02-22 05:46 dregad Summary Versions from existing filter not preselected when editing it => Versions and Categories from existing filter not preselected when editing it
2012-02-22 05:46 dregad Description Updated View Revisions
2012-02-23 18:25 dregad Note Added: 0031306
2012-02-24 05:22 dhx Note Added: 0031308
2012-02-24 05:22 dhx Note Edited: 0031308 View Revisions
2012-02-24 05:23 dhx Relationship added related to 0007995
2012-02-24 11:12 dhx Note Added: 0031312
2012-02-24 11:42 dregad Note Added: 0031313
2012-02-24 12:00 dhx Changeset attached => MantisBT master 79c04ca2
2012-02-24 12:00 dhx Changeset attached => MantisBT master 1f515b3a
2012-02-24 12:00 dhx Assigned To dregad => dhx
2012-02-24 12:00 dhx Status assigned => resolved
2012-02-24 12:00 dhx Resolution open => fixed
2012-02-24 12:00 dhx Fixed in Version => 1.3.0-beta.1
2012-02-27 09:37 dregad Note Added: 0031335
2012-02-27 09:37 dregad Resolution fixed => reopened
2012-02-27 09:38 dregad Status resolved => assigned
2012-03-01 18:01 dhx Relationship added related to 0011124
2012-03-04 09:23 atrol Target Version 1.2.9 => 1.2.10
2012-04-02 02:33 atrol Target Version 1.2.10 => 1.2.11
2012-06-07 13:43 atrol Target Version 1.2.11 => 1.2.12
2012-11-10 19:04 dregad Target Version 1.2.12 => 1.2.13
2013-01-22 09:48 dregad Target Version 1.2.13 => 1.2.14
2013-01-29 09:28 dregad Target Version 1.2.14 => 1.2.15
2013-04-12 09:57 dregad Target Version 1.2.15 => 1.2.16
2013-08-16 12:50 atrol Note Added: 0037893
2013-08-16 12:50 atrol Assigned To dhx => dregad
2013-10-21 18:37 dregad Note Added: 0038324
2013-10-21 18:37 dregad Status assigned => resolved
2013-10-21 18:37 dregad Resolution reopened => fixed
2013-10-21 18:37 dregad Target Version 1.2.16 => 1.3.0-beta.1
2013-12-01 22:04 govind Note Added: 0038698
2013-12-01 22:05 govind Note Added: 0038743
2014-12-08 00:34 vboctor Status resolved => closed