Fossil SCM
Fix minor issues with Forum editing.
Commit
c626d1c06cfd05d56ddca359b74e5b6a5414efdf38ee62d14cd59f72ea07d953
Parent
4814c41a9a9be40…
1 file changed
+14
+14
| --- src/forum.c | ||
| +++ src/forum.c | ||
| @@ -274,10 +274,24 @@ | ||
| 274 | 274 | itemId = forum_post(itemId,parentId,&zErr); |
| 275 | 275 | if( itemId ){ |
| 276 | 276 | cgi_redirectf("%R/forum?item=%d",itemId); |
| 277 | 277 | return; |
| 278 | 278 | } |
| 279 | + } | |
| 280 | + if( itemId && (P("m")==0 || P("b")==0) ){ | |
| 281 | + Stmt q; | |
| 282 | + db_prepare(&q, "SELECT mimetype, mbody FROM forumpost" | |
| 283 | + " WHERE mpostid=%d", itemId); | |
| 284 | + if( db_step(&q)==SQLITE_ROW ){ | |
| 285 | + if( P("m")==0 ){ | |
| 286 | + cgi_set_query_parameter("m", db_column_text(&q, 0)); | |
| 287 | + } | |
| 288 | + if( P("b")==0 ){ | |
| 289 | + cgi_set_query_parameter("b", db_column_text(&q, 1)); | |
| 290 | + } | |
| 291 | + } | |
| 292 | + db_finalize(&q); | |
| 279 | 293 | } |
| 280 | 294 | zMime = wiki_filter_mimetypes(P("m")); |
| 281 | 295 | if( itemId>0 ){ |
| 282 | 296 | style_header("Edit Forum Post"); |
| 283 | 297 | }else if( parentId>0 ){ |
| 284 | 298 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -274,10 +274,24 @@ | |
| 274 | itemId = forum_post(itemId,parentId,&zErr); |
| 275 | if( itemId ){ |
| 276 | cgi_redirectf("%R/forum?item=%d",itemId); |
| 277 | return; |
| 278 | } |
| 279 | } |
| 280 | zMime = wiki_filter_mimetypes(P("m")); |
| 281 | if( itemId>0 ){ |
| 282 | style_header("Edit Forum Post"); |
| 283 | }else if( parentId>0 ){ |
| 284 |
| --- src/forum.c | |
| +++ src/forum.c | |
| @@ -274,10 +274,24 @@ | |
| 274 | itemId = forum_post(itemId,parentId,&zErr); |
| 275 | if( itemId ){ |
| 276 | cgi_redirectf("%R/forum?item=%d",itemId); |
| 277 | return; |
| 278 | } |
| 279 | } |
| 280 | if( itemId && (P("m")==0 || P("b")==0) ){ |
| 281 | Stmt q; |
| 282 | db_prepare(&q, "SELECT mimetype, mbody FROM forumpost" |
| 283 | " WHERE mpostid=%d", itemId); |
| 284 | if( db_step(&q)==SQLITE_ROW ){ |
| 285 | if( P("m")==0 ){ |
| 286 | cgi_set_query_parameter("m", db_column_text(&q, 0)); |
| 287 | } |
| 288 | if( P("b")==0 ){ |
| 289 | cgi_set_query_parameter("b", db_column_text(&q, 1)); |
| 290 | } |
| 291 | } |
| 292 | db_finalize(&q); |
| 293 | } |
| 294 | zMime = wiki_filter_mimetypes(P("m")); |
| 295 | if( itemId>0 ){ |
| 296 | style_header("Edit Forum Post"); |
| 297 | }else if( parentId>0 ){ |
| 298 |