Anonymous | Login | Signup for a new account | 2012-09-13 19:33 PDT |
Main | Blog | My View | View Issues | Change Log | Roadmap | IRC Chat | Repositories | Scrum Board |
View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||
203 | Source Integration | [All Projects] General | public | 2011-03-20 11:25 | 2011-03-20 11:26 | ||||||
Reporter | Carl | ||||||||||
Assigned To | |||||||||||
Priority | normal | Severity | block | Reproducibility | always | ||||||
Status | new | Resolution | open | ||||||||
Product Version | 0.13 | ||||||||||
Target Version | Fixed in Version | ||||||||||
Summary | 203: search_page.php times out when Source_Date_Select() called and no changesets exist in the db | ||||||||||
Description | search_page.php hangs when Source_Date_Select() is called and no changesets exist in the `mantis_plugin_Source_changeset_table` table | ||||||||||
Steps To Reproduce | Empty `mantis_plugin_Source_changeset_table` and go to repositories then go to search (http://mymantis.com/plugin.php?page=Source/search_page [^]) | ||||||||||
Additional Information | It gets stuck in this for loop under this condition because $s_max and $_min are null for( $t_year = $s_max; $t_year >= $s_min; $t_year-- ) { echo '<option value="', $t_year, ( $t_year === $t_selected[0] ? '" selected="selected"' : '"' ), '>', $t_year, '</option>'; } One way is to ensure $s_min and $s_max aren't null when assigning them by doing something like this: Before: $s_min = $t_row['min'][0]; $s_max = $t_row['max'][0]; After: $s_min = is_null($t_row['min'][0]) ? 1970 : $t_row['min'][0]; $s_max = is_null($t_row['max'][0]) ? date('Y', time()) : $t_row['max'][0]; Another solution is to check if they're null before calling the for loop: Before: for( $t_year = $s_max; $t_year >= $s_min; $t_year-- ) { echo '<option value="', $t_year, ( $t_year === $t_selected[0] ? '" selected="selected"' : '"' ), '>', $t_year, '</option>'; } After: if (is_null($s_min) || is_null($s_max)) { echo '<option value="">No changesets found</option>'; /*plugin_lang_get*/ } else { for( $t_year = $s_max; $t_year >= $s_min; $t_year-- ) { echo '<option value="', $t_year, ( $t_year === $t_selected[0] ? '" selected="selected"' : '"' ), '>', $t_year, '</option>'; } } | ||||||||||
Tags | No tags attached. | ||||||||||
Attached Files | |||||||||||
![]() |
|||
Date Modified | Username | Field | Change |
2011-03-20 11:25 | Carl | New Issue |
Copyright © 2000 - 2012 MantisBT Group
Time: 0.1238 seconds. memory usage: 8,322 KB |