View Issue Details

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

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

SYSTEM 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 : https://www.mantisbt.org/bugs/print_all_bug_page.php
Tested on two other Mantis 2.2.0

Thanks
Romain

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 https://www.mantisbt.org/bugs/print_all_bug_page.php -> no error
  2. remove MANTIS_VIEW_ALL_COOKIE
  3. go to https://www.mantisbt.org/bugs/print_all_bug_page.php -> error occurs
  4. go to view issues page and click Reset Filter button
  5. go to https://www.mantisbt.org/bugs/print_all_bug_page.php -> no error
TagsNo tags attached.

Relationships

has duplicate 0022453 closedatrol Printing reports - system error 

Activities

dregad

dregad

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)

dregad

dregad

2017-03-01 12:56

developer   ~0055843

PR https://github.com/mantisbt/mantisbt/pull/1039

dregad

dregad

2017-03-01 12:57

developer   ~0055844

Reducing severity to minor since there's a simple workaround

cproensa

cproensa

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

dregad

dregad

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.

rct

rct

2017-03-02 09:46

reporter   ~0055871

Ok nice thank you.

Related Changesets

MantisBT: master-2.2 5bd51cc9

2017-03-01 07:49

dregad


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
given'.

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
0022442
mod - print_all_bug_page.php Diff File