Fossil SCM
Make sure the MODREQ table exists before using it in the "modreq" webpage.
Commit
def256a23be85d32841e731bc35f426381eb5f24
Parent
d3d094ff55d9ab8…
1 file changed
+10
-8
+10
-8
| --- src/moderate.c | ||
| +++ src/moderate.c | ||
| @@ -150,15 +150,17 @@ | ||
| 150 | 150 | |
| 151 | 151 | login_check_credentials(); |
| 152 | 152 | if( !g.perm.RdWiki && !g.perm.RdTkt ){ login_needed(); return; } |
| 153 | 153 | style_header("Pending Moderation Requests"); |
| 154 | 154 | @ <h2>All Pending Moderation Requests</h2> |
| 155 | - blob_init(&sql, timeline_query_for_www(), -1); | |
| 156 | - blob_appendf(&sql, | |
| 157 | - " AND event.objid IN (SELECT objid FROM modreq)" | |
| 158 | - " ORDER BY event.mtime DESC" | |
| 159 | - ); | |
| 160 | - db_prepare(&q, blob_str(&sql)); | |
| 161 | - www_print_timeline(&q, 0, 0, 0, 0); | |
| 162 | - db_finalize(&q); | |
| 155 | + if( moderation_table_exists() ){ | |
| 156 | + blob_init(&sql, timeline_query_for_www(), -1); | |
| 157 | + blob_appendf(&sql, | |
| 158 | + " AND event.objid IN (SELECT objid FROM modreq)" | |
| 159 | + " ORDER BY event.mtime DESC" | |
| 160 | + ); | |
| 161 | + db_prepare(&q, blob_str(&sql)); | |
| 162 | + www_print_timeline(&q, 0, 0, 0, 0); | |
| 163 | + db_finalize(&q); | |
| 164 | + } | |
| 163 | 165 | style_footer(); |
| 164 | 166 | } |
| 165 | 167 |
| --- src/moderate.c | |
| +++ src/moderate.c | |
| @@ -150,15 +150,17 @@ | |
| 150 | |
| 151 | login_check_credentials(); |
| 152 | if( !g.perm.RdWiki && !g.perm.RdTkt ){ login_needed(); return; } |
| 153 | style_header("Pending Moderation Requests"); |
| 154 | @ <h2>All Pending Moderation Requests</h2> |
| 155 | blob_init(&sql, timeline_query_for_www(), -1); |
| 156 | blob_appendf(&sql, |
| 157 | " AND event.objid IN (SELECT objid FROM modreq)" |
| 158 | " ORDER BY event.mtime DESC" |
| 159 | ); |
| 160 | db_prepare(&q, blob_str(&sql)); |
| 161 | www_print_timeline(&q, 0, 0, 0, 0); |
| 162 | db_finalize(&q); |
| 163 | style_footer(); |
| 164 | } |
| 165 |
| --- src/moderate.c | |
| +++ src/moderate.c | |
| @@ -150,15 +150,17 @@ | |
| 150 | |
| 151 | login_check_credentials(); |
| 152 | if( !g.perm.RdWiki && !g.perm.RdTkt ){ login_needed(); return; } |
| 153 | style_header("Pending Moderation Requests"); |
| 154 | @ <h2>All Pending Moderation Requests</h2> |
| 155 | if( moderation_table_exists() ){ |
| 156 | blob_init(&sql, timeline_query_for_www(), -1); |
| 157 | blob_appendf(&sql, |
| 158 | " AND event.objid IN (SELECT objid FROM modreq)" |
| 159 | " ORDER BY event.mtime DESC" |
| 160 | ); |
| 161 | db_prepare(&q, blob_str(&sql)); |
| 162 | www_print_timeline(&q, 0, 0, 0, 0); |
| 163 | db_finalize(&q); |
| 164 | } |
| 165 | style_footer(); |
| 166 | } |
| 167 |