Fossil SCM

Fix minor issues with Forum editing.

drh 2018-06-16 15:08 UTC forum-brainstorm-1
Commit c626d1c06cfd05d56ddca359b74e5b6a5414efdf38ee62d14cd59f72ea07d953
1 file changed +14
+14
--- src/forum.c
+++ src/forum.c
@@ -274,10 +274,24 @@
274274
itemId = forum_post(itemId,parentId,&zErr);
275275
if( itemId ){
276276
cgi_redirectf("%R/forum?item=%d",itemId);
277277
return;
278278
}
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);
279293
}
280294
zMime = wiki_filter_mimetypes(P("m"));
281295
if( itemId>0 ){
282296
style_header("Edit Forum Post");
283297
}else if( parentId>0 ){
284298
--- 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

Keyboard Shortcuts

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