View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0035291 | mantisbt | filters | public | 2025-02-03 10:23 | 2025-02-04 08:10 |
Reporter | chadmiss | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | confirmed | Resolution | open | ||
Product Version | 2.25.7 | ||||
Target Version | 2.27.1 | ||||
Summary | 0035291: Filters including date custom fields don't work on PHP 8.0 | ||||
Description | wie did a version bump from 2.25.2 to 2.25.7 and now none of the filters on view_all_bug_page are working. I boiled it down to a custom-field that appears in the filter_string in filters_table. that custom-field is a date and in the database its value for the filter is ["","1","1"]. that is a very old custom-field and in virtually every filters present. I found out that fixing the value to ["0","1","1"] brings the filters back to work. I am just not sure if this is the correct solution or if this is a bug on our end (we've been using Mantis with version bumping for the past 15 years. yikes!) | ||||
Tags | No tags attached. | ||||
It's not clear what you mean by none of the filters on view_all_bug_page are working - can you be more specific ? Error message ? Unexpected behavior ?
I did not check, but It is possible that in some ancient MantisBT version, "any" was stored as null, hence the entries in your filters table. Can you confirm that those records are for the latest version (filter_string column should start with It may also be super useful, if you know how to do that, to run a git bisect between release-2.25.2 and release-2.25.7 tags, to identify the commit which introduced the regression for you. |
|
I tried updating a test saved filter showing all assigned issues with SQL to have In the filters grid, instead of showing any, the custom field is it's just an empty string (see screenshot), and there are no Issues returned (there should have been 3). This is with PHP 8.2. If I run the exact same test with PHP 7.4, I get the expected behavior (i.e. mydate field filter shows any and the 3 Issues are listed). And all this is regardless of MantisBT version: tried with 2.25.2, 2.25.7 and master, same results. So, what is your PHP version ? |
|
sorry about the missed info. so I guess it is because of the PHP update. Said customfield is one of the oldest we still have in use. So this really seems so be an ancient relic. I think we will do a string-replacement in the Database to fix this value thanks for the reply! |
|
That's it then. I think it will be difficult and probably not worth the effort to identify the root cause, i.e. why your filters are stored as I'll investigate what is causing the date filter to fail when the type is '' (empty string) instead of the expected integer, as it sounds like a regression introduced by PHP 8.x. As a side note, why limit your upgrade to 2.25.7 and not a more recent MantisBT release ? I strongly recommend upgrading at least to 2.26.4 to address several security issues and benefit from improved PHP 8.x support (especially considering that you are now on 8.1.2). Note that 2.27.0 has a few known issues, 2.27.1 should be released soon. |
|
OK, I nailed it. The problem comes from this check in BugFilterQuery::build_prop_custom_fields() at line 1470:
In PHP <= 7.x,
And so it hit us (you) ;-) |
|