View Issue Details

IDProjectCategoryView StatusLast Update
0014441mantisbttaggingpublic2025-01-18 16:20
Reporterus3r Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionno change required 
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 
related to 0014774 closeddregad Fix issue in tag api with odbc_mssql driver 

Activities

dregad

dregad

2025-01-07 09:15

developer   ~0069643

We are resolving this issue as "no change required", because it was reported against an old version of MantisBT which is no longer supported.

The problem was possibly fixed by 0014774, or by later changes and refactoring of tag API in 1.3 / 2.x.

We recommend that you upgrade to the latest stable version [1]; if the problem persists after doing so, do not hesitate to reopen the issue.

[1] https://mantisbt.org/download.php