Mantis Bug Tracker
 

View Issue Details Jump to Notes ] Wiki ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0010901mantisbtcustom fieldspublic2009-09-03 16:342010-04-06 04:43
Reporterbighux 
Assigned Todhx 
PrioritynormalSeveritymajorReproducibilityalways
StatusresolvedResolutionduplicate 
PlatformApache 2.2.12 + PHP 5.3.0 OSWindowsOS VersionXP
Product Version1.2.0rc1 
Target Version1.3.xFixed in Version 
Summary0010901: We can't use & in custom field value and it's impossible search the first and last value from custom list
DescriptionWe can't use & in custom field value with type checkbox or multiselection list, otherwise the value is never selected in edit issue page. I don't have tried with others types.
It's impossible search the first and last value when the type of field is checkbox (or Multiselection list).
Steps To Reproduce1- Create custom field checkbox with 4 values (eg : value1|value2|value &3|value4) with "Add to Filter" and "Display When Reporting Issues" checked
2- Assign field on the project
3- Create issue and check 4 checkbox
4- The issue information is displayed and it is correct
5- Click on edit issue
6- The checkbox value &3 isn't checked (it's a problem)
7- Go to View Issues page
8- Select in filters the custom field with value1 (or value4), apply filter
9- No issue found, it's a problem
10-If the value selected is value2 or value &3, the issue is displayed in the list
Tagspatch
Attached Filespng file icon bugMantisCustomField.png [^] (2,626 bytes) 2009-09-03 16:34


diff file icon bug_10901.diff [^] (2,280 bytes) 2009-12-27 18:55 [Show Content]

- Relationships
duplicate of 0011561closeddhx Filtering for custom field types multilist and checkbox does not work 
duplicate of 0003767new Enumeration Custum fields with html-special chars get unselected on bug-update 
has duplicate 0011011assigneddhx Can't add UTF8 custom fields to the Manage columns enumeration 
has duplicate 0011634closeddhx using special characters on Custom Field name generates issue when trying to order by this CF 
has duplicate 0011631closeddhx Custom Fields with special characters in the name cause SQL errors on sort. 

-  Notes
User avatar (0023015)
bighux (reporter)
2009-09-22 11:13

I have found the problem filter value (but not the bug with &)in /core/filter_api.php line 1878
Add the code bellow between array_push et break and it's work

$t_where_params[] = $t_filter_member . '|%';
array_push( $t_filter_array, db_helper_like( "$t_table_name.value" ) );
$t_where_params[] = '%|' . $t_filter_member;
array_push( $t_filter_array, db_helper_like( "$t_table_name.value" ) );
$t_where_params[] = $t_filter_member;
array_push( $t_filter_array, db_helper_like( "$t_table_name.value" ) );
User avatar (0023680)
biitli (reporter)
2009-11-12 05:43

I have the same problem with Mantis 1.1.8. Maybe it is a problem with usage of html entities? '&' seems to be stored as '&' and compared with '&' (or vice versa)
User avatar (0023684)
yw84ever (reporter)
2009-11-12 06:49

biitli: remove your sponsoring by sponsoring an amount of $0
User avatar (0023991)
andygrunwald (reporter)
2009-12-27 18:58
edited on: 2009-12-27 19:00

Hey,

i had a deeper look in this bug. There are two different issues:
a) a filter bug (to build the correct search query for custom fields)
b) a custom field display bug

bighux writes down a solution for part a. This solutions works fine in my tests. Thanks for this bighux.
biitli gives me a hint for part b of this bug. so i went down into the sourcecode to fix it. My solution works fone in my tests, too.

My patch is added.
this patch is based on the nightly build mantisbt-1.3.0dev-2009-12-27-master-8c404a1.tar. I hope there are no code changed between mantisbt-1.3.0dev-2009-12-27-master-8c404a1.tar and MantisBT 1.2.0 RC2 to get this patch in 1.2.0

Have a nice day,
Andy

User avatar (0024711)
dhx (developer)
2010-03-12 08:32

The filtering bug has been fixed in 0011561

Thanks Andy for your patch! I actually did the same thing as your patch without seeing this bug first. However, the approach of using multiple LIKE queries is poor and unintended, so the 2nd patch in 0011561 fixes it more properly.

I'll keep this bug open to keep track of the other issue at hand here (using ampersands and other special characters in a custom field name/values).
User avatar (0024716)
dhx (developer)
2010-03-12 09:14

Please see duplicate issue 0003767 for further updates and discussion.

This bug is OLD :(

- Issue History
Date Modified Username Field Change
2009-09-03 16:34 bighux New Issue
2009-09-03 16:34 bighux File Added: bugMantisCustomField.png
2009-09-22 11:13 bighux Note Added: 0023015
2009-09-22 19:38 dhx Target Version => 1.2.2
2009-10-06 16:49 jreese Target Version 1.2.0 RC2 => 1.2.2
2009-11-12 05:35 biitli Sponsorship Added biitli: US$ 10
2009-11-12 05:35 biitli Sponsorship Total 0 => 10
2009-11-12 05:35 biitli Issue Monitored: biitli
2009-11-12 05:38 biitli Note Added: 0023679
2009-11-12 05:43 biitli Note Added: 0023680
2009-11-12 06:49 yw84ever Note Added: 0023684
2009-11-12 06:55 biitli Sponsorship Deleted biitli: US$ 10
2009-11-12 06:55 biitli Sponsorship Total 10 => 0
2009-11-12 06:56 biitli Note Deleted: 0023679
2009-12-27 18:55 andygrunwald File Added: bug_10901.diff
2009-12-27 18:58 andygrunwald Note Added: 0023991
2009-12-27 19:00 andygrunwald Note Edited: 0023991 View Revisions
2009-12-28 03:21 vboctor Tag Attached: patch
2009-12-28 03:21 vboctor Status new => confirmed
2010-01-02 00:53 vboctor Target Version 1.2.2 => 1.3.x
2010-03-12 08:28 dhx Relationship added duplicate of 0011561
2010-03-12 08:32 dhx Note Added: 0024711
2010-03-12 08:34 dhx Relationship added has duplicate 0011011
2010-03-12 08:35 dhx Issue Monitored: ykrest
2010-03-12 08:35 dhx Issue Monitored: watergad
2010-03-12 08:35 dhx Relationship added has duplicate 0011634
2010-03-12 08:36 dhx Issue Monitored: fman
2010-03-12 08:36 dhx Relationship added has duplicate 0011631
2010-03-12 08:36 dhx Issue Monitored: RyanLind
2010-03-12 09:14 dhx Note Added: 0024716
2010-03-12 09:14 dhx Relationship added duplicate of 0003767
2010-03-12 09:14 dhx Status confirmed => resolved
2010-03-12 09:14 dhx Resolution open => duplicate
2010-03-12 09:14 dhx Assigned To => dhx
2010-04-06 04:43 watergad Issue End Monitor: watergad


MantisBT 1.2.2 git master-1.2.x[^]
Copyright © 2000 - 2010 MantisBT Group
Time: 0.2560 seconds.
memory usage: 2,032 KB
Powered by Mantis Bugtracker