Fossil SCM

Fix the display of /reports?view=byweek with an invalid user.

drh 2015-05-18 20:00 UTC andygoth-user-reports
Commit 5fa4d0125cbd7bf86b9c4c32c0a37de27dc0f383
1 file changed +7 -1
+7 -1
--- src/statrep.c
+++ src/statrep.c
@@ -590,11 +590,17 @@
590590
azYear[n+1] = azYear[n];
591591
if( !isValidYear && fossil_strcmp(zYear,azYear[n])==0 ) isValidYear = 1;
592592
n += 2;
593593
}
594594
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
+ }
596602
style_submenu_multichoice("y", n/2, (const char**)azYear, 0);
597603
cgi_printf("<br/>");
598604
db_prepare(&q,
599605
"SELECT DISTINCT strftime('%%W',mtime) AS wk, "
600606
" count(*) AS n "
601607
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button