Fossil SCM
Fix the display of /reports?view=byweek with an invalid user.
Commit
5fa4d0125cbd7bf86b9c4c32c0a37de27dc0f383
Parent
4d60469f15833c6…
1 file changed
+7
-1
+7
-1
| --- src/statrep.c | ||
| +++ src/statrep.c | ||
| @@ -590,11 +590,17 @@ | ||
| 590 | 590 | azYear[n+1] = azYear[n]; |
| 591 | 591 | if( !isValidYear && fossil_strcmp(zYear,azYear[n])==0 ) isValidYear = 1; |
| 592 | 592 | n += 2; |
| 593 | 593 | } |
| 594 | 594 | db_finalize(&q); |
| 595 | - if( !isValidYear ) zYear = azYear[0]; | |
| 595 | + if( !isValidYear ){ | |
| 596 | + if( n ){ | |
| 597 | + zYear = azYear[0]; | |
| 598 | + }else{ | |
| 599 | + zYear = db_text("1970","SELECT substr(date('now'),1,4);"); | |
| 600 | + } | |
| 601 | + } | |
| 596 | 602 | style_submenu_multichoice("y", n/2, (const char**)azYear, 0); |
| 597 | 603 | cgi_printf("<br/>"); |
| 598 | 604 | db_prepare(&q, |
| 599 | 605 | "SELECT DISTINCT strftime('%%W',mtime) AS wk, " |
| 600 | 606 | " count(*) AS n " |
| 601 | 607 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -590,11 +590,17 @@ | |
| 590 | azYear[n+1] = azYear[n]; |
| 591 | if( !isValidYear && fossil_strcmp(zYear,azYear[n])==0 ) isValidYear = 1; |
| 592 | n += 2; |
| 593 | } |
| 594 | db_finalize(&q); |
| 595 | if( !isValidYear ) zYear = azYear[0]; |
| 596 | style_submenu_multichoice("y", n/2, (const char**)azYear, 0); |
| 597 | cgi_printf("<br/>"); |
| 598 | db_prepare(&q, |
| 599 | "SELECT DISTINCT strftime('%%W',mtime) AS wk, " |
| 600 | " count(*) AS n " |
| 601 |
| --- src/statrep.c | |
| +++ src/statrep.c | |
| @@ -590,11 +590,17 @@ | |
| 590 | azYear[n+1] = azYear[n]; |
| 591 | if( !isValidYear && fossil_strcmp(zYear,azYear[n])==0 ) isValidYear = 1; |
| 592 | n += 2; |
| 593 | } |
| 594 | db_finalize(&q); |
| 595 | if( !isValidYear ){ |
| 596 | if( n ){ |
| 597 | zYear = azYear[0]; |
| 598 | }else{ |
| 599 | zYear = db_text("1970","SELECT substr(date('now'),1,4);"); |
| 600 | } |
| 601 | } |
| 602 | style_submenu_multichoice("y", n/2, (const char**)azYear, 0); |
| 603 | cgi_printf("<br/>"); |
| 604 | db_prepare(&q, |
| 605 | "SELECT DISTINCT strftime('%%W',mtime) AS wk, " |
| 606 | " count(*) AS n " |
| 607 |