View Issue Details

IDProjectCategoryView StatusLast Update
0014441mantisbttaggingpublic2012-07-02 12:01
Reporterus3r Assigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status acknowledgedResolutionopen 
PlatformWindows Server with IISOSWindows 2003 R2OS VersionWindows 2003 R2
Product Version1.2.11 
Summary0014441: view.php - Tag Selection Dropdown only shows 'Exisiting Tags' but none of the actual tags in existence
Description

In view.php the drop down field for tag selection shows only 'Existing Tags'.

When I look into the source code I find:
<option value="0">Existing tags</option>
<p style="color:red">SYSTEM WARNING: 'Invalid argument supplied for foreach()' in 'C:[...]mantis\core\print_api.php' line 321</p>

So here the problem seems to be with
$query = "SELECT t.id FROM $t_tag_table t
LEFT JOIN $t_bug_tag_table b ON t.id=b.tag_id
WHERE b.bug_id IS NULL OR b.bug_id != " . db_param();
in tag_api.php line 468.

As soon as I change this SQL, like
$query = "SELECT t.id FROM $t_tag_table t
LEFT JOIN $t_bug_tag_table b ON t.id=b.tag_id
WHERE b.bug_id IS NULL ";
or
$query = "SELECT t.id FROM $t_tag_table t
LEFT JOIN $t_bug_tag_table b ON t.id=b.tag_id
WHERE b.bug_id IS NULL OR b.bug_id != 1";
I receive the error:
Database query failed. Error received from database was 0002812: Could not find stored procedure 'NE'. for the query: SELECT t.id FROM mantis_tag_table t
LEFT JOIN mantis_bug_tag_table b ON t.id=b.tag_id
WHERE b.bug_id IS NULL OR b.bug_id != 1.

When I use the second query ( OR b.bug_id != 1 ) directly in the database I get a result.

db_param() returns '?'. When I run the query "[...]OR b.bug_id != ?" directly in the database I also get an error.

My guess is a problem with the SQL code and MS SQL but I was not able to solve it.

Steps To Reproduce

Install Mantis 1.2.11 on Windows 2003 R2 with IIS and MS SQL 2008 database.

Open view.php by opening any Bug.

Additional Information

After installing, I was able to create tags in
Manage -> Manage Tags
without problems, but they were not displayed properly but like:

Name Creator Date Created Last Updated
user0 1970-01-01 01:00 1970-01-01 01:00

The problem here was, that the sql returned a numeric key but Mantis code uses named keys.

I set
define('ADODB_FETCH_ASSOC',2);
to
define('ADODB_FETCH_ASSOC',1);
in library/adodb/adodb.inc.php line 110 and the tags were displayed properly.

The tag drop down in view.php does not work with either setting, I just wanted to mention it in case it impacts the problem.

TagsNo tags attached.

Relationships

related to 0014395 closeddregad Critical Failure when Assigning Tags to Multiple Issues at Once 

Activities

There are no notes attached to this issue.