View Issue Details

IDProjectCategoryView StatusLast Update
0022442mantisbtprintingpublic2017-03-12 19:23
Reporterrct Assigned Todregad  
Status closedResolutionfixed 
Product Version2.2.0 
Target Version2.2.1Fixed in Version2.2.1 
Summary0022442: System error when opening Print reports

When viewing issues then click the print reports buttons there is an error

'Argument 1 passed to filter_get_visible_sort_properties_array() must be an array, null given, called in /srv/www/bugs/print_all_bug_page.php on line 201 and defined' in '/srv/www/bugs/core/filter_api.php' line 3377

Source site :
Tested on two other Mantis 2.2.0


Steps To Reproduce

This bug happens when you haven't navigated too much into Mantis (???!!!). If you don't see this error clear all your browser cache then retry you should see the error then navigate through the site (change project, view issues, changelog, ...) and check again you won't probably see the error.

Cookies ?

EDIT (dregad):

  1. go to -> no error
  3. go to -> error occurs
  4. go to view issues page and click Reset Filter button
  5. go to -> no error
TagsNo tags attached.


has duplicate 0022453 closedatrol Printing reports - system error 




2017-03-01 12:44

developer   ~0055842

I can reproduce the problem; updated the steps to reproduce.

The problem is indeed as you suspected caused by the absence of the VIEW_ALL_COOKIE; the code does not cover this case, so the filter is not properly initialized (SYSTEM NOTICE: 'Undefined variable: t_filter_cookie_arr' in '/home/ubuntu/workspace/mantisbt/print_all_bug_page.php' line 201)



2017-03-01 12:56

developer   ~0055843




2017-03-01 12:57

developer   ~0055844

Reducing severity to minor since there's a simple workaround



2017-03-01 12:58

developer   ~0055845

@dregad let me know if i have to look at this for a fix
i assigned initially since that function filter_get_visible_sort_properties_array() was introduced as part of filter api rewrites



2017-03-01 13:07

developer   ~0055846

Targetting 2.2.1 per discussion with @vboctor on Gitter.

@cproensa Thanks but I don't think your help is needed. IMO the issue is not with the new API function, even though its introduction revealed the problem. Feel free to review the PR though.



2017-03-02 09:46

reporter   ~0055871

Ok nice thank you.

Related Changesets

MantisBT: master-2.2 5bd51cc9

2017-03-01 12:49:59


Details Diff
Fix print page error when cookie not set

When the VIEW_ALL_COOKIE is not set or blank, an attempt to display
print_all_bug_page.php will trigger a system error: 'Argument 1 passed
to filter_get_visible_sort_properties_array() must be an array, null

This is due to the filter ($t_filter_cookie_arr) not being initialized
in this case, leading to an error as it's defaulted to NULL while the
filter_get_visible_sort_properties_array() function expects an array.

Use a default filter when the cookie is not set or empty.

Fixes 0022442
Affected Issues
mod - print_all_bug_page.php Diff File

Issue History

Date Modified Username Field Change
2017-03-01 11:18 rct New Issue
2017-03-01 11:32 dregad Status new => confirmed
2017-03-01 12:38 cproensa Assigned To => cproensa
2017-03-01 12:38 cproensa Status confirmed => assigned
2017-03-01 12:44 dregad Assigned To cproensa =>
2017-03-01 12:44 dregad Status assigned => confirmed
2017-03-01 12:44 dregad Description Updated View Revisions
2017-03-01 12:44 dregad Steps to Reproduce Updated View Revisions
2017-03-01 12:44 dregad Note Added: 0055842
2017-03-01 12:56 dregad Assigned To => dregad
2017-03-01 12:56 dregad Status confirmed => assigned
2017-03-01 12:56 dregad Note Added: 0055843
2017-03-01 12:57 dregad Severity major => minor
2017-03-01 12:57 dregad Target Version => 2.3.0
2017-03-01 12:57 dregad Note Added: 0055844
2017-03-01 12:58 cproensa Note Added: 0055845
2017-03-01 13:07 dregad Target Version 2.3.0 => 2.2.1
2017-03-01 13:07 dregad Note Added: 0055846
2017-03-02 09:46 rct Note Added: 0055871
2017-03-02 11:44 atrol Relationship added has duplicate 0022453
2017-03-03 12:05 dregad Summary Print reports => System error when opening Print reports
2017-03-04 05:10 dregad Changeset attached => MantisBT master-2.2 5bd51cc9
2017-03-04 05:10 dregad Status assigned => resolved
2017-03-04 05:10 dregad Resolution open => fixed
2017-03-04 06:15 dregad Fixed in Version => 2.2.1
2017-03-12 19:23 vboctor Status resolved => closed