View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0000805 | mantisbt | sql | public | 2001-08-17 08:53 | 2001-08-26 16:09 |
Reporter | AJC | Assigned To | prescience | ||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Summary | 0000805: Search results have wrong bug ID's | ||||
Description | Another bug found since I manually changed the bug_table id numbers to be the same as our current bugs list... The search results use the bug_text_table id numbers rather than the bug_table id numbers for the bug links. | ||||
Additional Information | This can be fixed by only including the bug_table id column in the result from MySQL. Change the query in line 108 of view_all_bug_page.php to: | ||||
Tags | No tags attached. | ||||
I don't quite follow. Can you provide a larger code snippet? |
|
The current code builds the search query to give: SELECT * FROM $g_mantis_bug_table,$g_mantis_bug_text_table WHERE ... When listing the results from the search, the hyperlinked bug number uses the "id" field from the result from the above SQL query. But there are two "id" fields in the result, one from each table. The problem occurs when the bug_table id numbers to not coincide with the corresponding text table id numbers (which probably only happens if someone like me fiddles the bug id numbers). In this situation it seems to be the bug_text_table id number rather than the bug_table id number that is used for the link - so it links to the wrong bug. The current code only works when bug_text_table.id = bug_table.id for every bug(which it normally is). My modification is to build the SQL to have SELECT $g_mantis_bug_table., $g_mantis_bug_text_table.description FROM ... as the only field we need from the bug_text_table is the decription. By making this change we only get one "id" field in the result, which is the bug_table.id - the one we want. |
|
New code looks like: build our query string based on our viewing criteria |
|
Thanks AJC, I'll take a look when I get home. |
|
Fixed in CVS. Will be in 0.15.5 |
|