Notice: this is a static mirror for historical purposes.

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
203Source Integration[All Projects] Generalpublic2011-03-20 11:252011-03-20 11:26
ReporterCarl 
Assigned To 
PrioritynormalSeverityblockReproducibilityalways
StatusnewResolutionopen 
Product Version0.13 
Target VersionFixed in Version 
Summary203: search_page.php times out when Source_Date_Select() called and no changesets exist in the db
Descriptionsearch_page.php hangs when Source_Date_Select() is called and no changesets exist in the `mantis_plugin_Source_changeset_table` table
Steps To ReproduceEmpty `mantis_plugin_Source_changeset_table` and go to repositories then go to search (http://mymantis.com/plugin.php?page=Source/search_page [^])
Additional InformationIt 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>';
    }
}
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
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
Powered by Mantis Bugtracker

hosted with
Linode