Fossil SCM
Make sure the tkt_uuid and tkt_datetime TH1 variables are initialized on a ticket display, even if no matching ticket is found.
Commit
2664476fbc2dfd37ebda0a82e6ba19a4a557551b
Parent
55fc643edab6cbe…
1 file changed
+6
+6
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -137,15 +137,21 @@ | ||
| 137 | 137 | free(zRevealed); |
| 138 | 138 | } |
| 139 | 139 | }else{ |
| 140 | 140 | db_finalize(&q); |
| 141 | 141 | db_prepare(&q, "PRAGMA table_info(ticket)"); |
| 142 | + if( Th_Fetch("tkt_uuid",&size)==0 ){ | |
| 143 | + Th_Store("tkt_uuid",zName); | |
| 144 | + } | |
| 142 | 145 | while( db_step(&q)==SQLITE_ROW ){ |
| 143 | 146 | const char *zField = db_column_text(&q, 1); |
| 144 | 147 | if( Th_Fetch(zField, &size)==0 ){ |
| 145 | 148 | Th_Store(zField, ""); |
| 146 | 149 | } |
| 150 | + } | |
| 151 | + if( Th_Fetch("tkt_datetime",&size)==0 ){ | |
| 152 | + Th_Store("tkt_datetime",""); | |
| 147 | 153 | } |
| 148 | 154 | } |
| 149 | 155 | db_finalize(&q); |
| 150 | 156 | } |
| 151 | 157 | |
| 152 | 158 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -137,15 +137,21 @@ | |
| 137 | free(zRevealed); |
| 138 | } |
| 139 | }else{ |
| 140 | db_finalize(&q); |
| 141 | db_prepare(&q, "PRAGMA table_info(ticket)"); |
| 142 | while( db_step(&q)==SQLITE_ROW ){ |
| 143 | const char *zField = db_column_text(&q, 1); |
| 144 | if( Th_Fetch(zField, &size)==0 ){ |
| 145 | Th_Store(zField, ""); |
| 146 | } |
| 147 | } |
| 148 | } |
| 149 | db_finalize(&q); |
| 150 | } |
| 151 | |
| 152 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -137,15 +137,21 @@ | |
| 137 | free(zRevealed); |
| 138 | } |
| 139 | }else{ |
| 140 | db_finalize(&q); |
| 141 | db_prepare(&q, "PRAGMA table_info(ticket)"); |
| 142 | if( Th_Fetch("tkt_uuid",&size)==0 ){ |
| 143 | Th_Store("tkt_uuid",zName); |
| 144 | } |
| 145 | while( db_step(&q)==SQLITE_ROW ){ |
| 146 | const char *zField = db_column_text(&q, 1); |
| 147 | if( Th_Fetch(zField, &size)==0 ){ |
| 148 | Th_Store(zField, ""); |
| 149 | } |
| 150 | } |
| 151 | if( Th_Fetch("tkt_datetime",&size)==0 ){ |
| 152 | Th_Store("tkt_datetime",""); |
| 153 | } |
| 154 | } |
| 155 | db_finalize(&q); |
| 156 | } |
| 157 | |
| 158 |