View Issue Details

IDProjectCategoryView StatusLast Update
0023437mantisbtfilterspublic2020-09-17 16:40
Reporteratrol Assigned Toatrol  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Summary0023437: Fatal PHP error when trying to edit a stored filter
Description

Getting the following error when editing a stored filter for "All Projects"

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to filter_ensure_valid_filter() must be of the type array, boolean given,
called in /var/www/html/it/core/filter_api.php on line 965 and defined in /var/www/html/it/core/filter_api.php:549
Stack trace:
# 0 /var/www/html/it/core/filter_api.php(965): filter_ensure_valid_filter(false)
# 1 /var/www/html/it/manage_filter_edit_page.php(77): filter_deserialize('v9#false')
# 2 {main}
thrown in /var/www/html/it/core/filter_api.php on line 549, referer: https://<myURL>/it/manage_filter_page.php
  • select All Projects from project selection menu
  • goto View Issuespage
  • click Save Current filter
  • enter a Filter Name
  • click Save Current filter
  • click Manage Filters
  • click Editbutton` for the stored filter
TagsNo tags attached.

Relationships

related to 0024045 new filter_deserialize() calling filter_ensure_valid_filter() with wrong parameter type 

Activities

cproensa

cproensa

2017-10-05 05:33

developer   ~0057897

I couldn't reproduce with your steps...

Can you show what string is stored in database for that filter id? seems like it has stored literal 'v9#false', so the problem may be at creation+save of the filter.

Can you also try your error scenario with https://github.com/mantisbt/mantisbt/pull/1091 ?
see if the error can be reproduced with that PR, and/or: even if the bad filter is saved, then loading it does not result in php error.

atrol

atrol

2017-10-05 06:54

developer   ~0057898

I couldn't reproduce with your steps...

Tried a complete other system (XAMPP on Windows) and was also not able to reproduce.
Tried again on Ubuntu 16.04 and was able to reproduce.
I will have to check a complete fresh install and 100% same steps.

seems like it has stored literal 'v9#false'

right

Can you also try your error scenario with https://github.com/mantisbt/mantisbt/pull/1091 ?

Not at the moment, maybe tomorrow

cproensa

cproensa

2017-10-05 18:39

developer   ~0057901

By hardcoding a filter with corrupted data, said PR also throws errors.
I have added fixes there: https://github.com/mantisbt/mantisbt/pull/1091

I'm not sure if it's worth to do the same approach for fixes in current code. The point of rewriting the load and save routines in that PR is precisely to help with these issues.

Still, i'd like to know how your scenario got the bad filter saved, in the first place.

atrol

atrol

2017-10-06 02:40

developer   ~0057902

I have added fixes there: https://github.com/mantisbt/mantisbt/pull/1091

Branch cproensa/0023436_edit_filter_project

  • does no longer store filters having v9#false in filter_string
  • is able to deal with filters having v9#false in filter_string without generating errors or warnings

Still, i'd like to know how your scenario got the bad filter saved, in the first place.

Me too, but I am not sure if it's better to invest time in reviewing and testing branch 0023436_edit_filter_project.

atrol

atrol

2020-09-06 08:30

developer   ~0064369

Tried again on Ubuntu 16.04 and was able to reproduce.

Tried latest master on Ubuntu 16.04 and was no longer able to reproduce.
I suppose this is fixed as branch cproensa/0023436_edit_filter_project is merged to master since quite a while.