Fossil SCM

Remove the unused description field from the forum-statuses setting.

stephan 2026-05-30 06:35 UTC trunk
Commit c56de3f19a5abd3e8e687cb3796b3e4a874d275b179cbbcdc9d36b2af7b30f2b
2 files changed +7 -11 +4 -5
+7 -11
--- src/forum.c
+++ src/forum.c
@@ -68,11 +68,10 @@
6868
** A single entry from the forum-statuses setting.
6969
*/
7070
struct ForumStatus {
7171
char *zLabel; /* Label for the UI */
7272
char *zValue; /* status=X tag value */
73
- char *zDescr; /* Brief description */
7473
};
7574
7675
/*
7776
** A list of ForumStatus objects.
7877
*/
@@ -113,37 +112,35 @@
113112
** list. A length-1 list is, for purposes of the UI, identical to
114113
** an empty one - status selection/filtering makes no sense if
115114
** there's only one choice. */
116115
db_multi_exec(
117116
"CREATE TEMP TABLE IF NOT EXISTS forumstatus("
118
- " ord INTEGER PRIMARY KEY,"
119
- " label, value, descr"
117
+ " ord INTEGER PRIMARY KEY, label, value"
120118
");"
121119
"DELETE FROM forumstatus;"
122
- "INSERT INTO forumstatus(label,value,descr)"
120
+ "INSERT INTO forumstatus(label,value)"
123121
" WITH setting(v) AS ("
124122
" SELECT value v FROM config WHERE name='forum-statuses'"
125123
" ),"
126124
" room(r) AS ("
127125
" SELECT e.value FROM setting s, jsonb_each(s.v) e"
128126
" WHERE json_valid(s.v, 0x02)"
129127
" )"
130
- " SELECT r->>'label', r->>'value', r->>'description'"
128
+ " SELECT r->>'label', r->>'value'"
131129
" FROM room;"
132130
);
133131
fses.n = (unsigned)db_int(0, "SELECT count(*) FROM forumstatus");
134132
if( fses.n ){
135133
int i = 0;
136134
Stmt q;
137
- db_prepare(&q,"SELECT label, value, descr FROM forumstatus"
138
- " ORDER BY ord");
135
+ db_prepare(&q,"SELECT label, value FROM forumstatus"
136
+ " ORDER BY ord");
139137
fses.aStatus = fossil_malloc(sizeof(fses.aStatus[0]) * fses.n);
140138
while( SQLITE_ROW==db_step(&q) ){
141139
ForumStatus * fs = &fses.aStatus[i++];
142140
fs->zLabel = fossil_strdup(db_column_text(&q, 0));
143141
fs->zValue = fossil_strdup(db_column_text(&q, 1));
144
- fs->zDescr = fossil_strdup(db_column_text(&q, 2));
145142
}
146143
db_finalize(&q);
147144
}
148145
}
149146
return &fses;
@@ -180,12 +177,11 @@
180177
unsigned i;
181178
db_find_and_open_repository(0,0);
182179
fses = forum_statuses();
183180
for(i = 0; i < fses->n; ++i ){
184181
const ForumStatus * fs = &fses->aStatus[i];
185
- fossil_print("Status: %!j %!j %!j\n",
186
- fs->zValue, fs->zLabel, fs->zDescr);
182
+ fossil_print("Status: %!j %!j\n", fs->zValue, fs->zLabel);
187183
assert( fs==forum_status_by_value(fs->zValue, 0) );
188184
}
189185
fossil_print("Total statuses: %u\n", i);
190186
}
191187
@@ -2232,11 +2228,11 @@
22322228
** unlimited but a limit may be imposed by the web server or a proxy.
22332229
**
22342230
** SETTING: forum-statuses width=40 block-text
22352231
** This JSON5-formatted value defines an array of objects describing
22362232
** the available statuses of forum posts. Each entry of the array must
2237
-** be an object in the form {label:"X",value:"Y",description:"Z"}.
2233
+** be an object in the form {label:"X",value:"Y"}.
22382234
** The label is used in the UI and value becomes the value of the
22392235
** "status" tag on forum posts. Any forum post which has a status
22402236
** value which does not appear in this list is treated as if it had
22412237
** the first value from this list. If this setting is empty, is
22422238
** ill-formed JSON, or has only a single entry then the forum will
22432239
--- src/forum.c
+++ src/forum.c
@@ -68,11 +68,10 @@
68 ** A single entry from the forum-statuses setting.
69 */
70 struct ForumStatus {
71 char *zLabel; /* Label for the UI */
72 char *zValue; /* status=X tag value */
73 char *zDescr; /* Brief description */
74 };
75
76 /*
77 ** A list of ForumStatus objects.
78 */
@@ -113,37 +112,35 @@
113 ** list. A length-1 list is, for purposes of the UI, identical to
114 ** an empty one - status selection/filtering makes no sense if
115 ** there's only one choice. */
116 db_multi_exec(
117 "CREATE TEMP TABLE IF NOT EXISTS forumstatus("
118 " ord INTEGER PRIMARY KEY,"
119 " label, value, descr"
120 ");"
121 "DELETE FROM forumstatus;"
122 "INSERT INTO forumstatus(label,value,descr)"
123 " WITH setting(v) AS ("
124 " SELECT value v FROM config WHERE name='forum-statuses'"
125 " ),"
126 " room(r) AS ("
127 " SELECT e.value FROM setting s, jsonb_each(s.v) e"
128 " WHERE json_valid(s.v, 0x02)"
129 " )"
130 " SELECT r->>'label', r->>'value', r->>'description'"
131 " FROM room;"
132 );
133 fses.n = (unsigned)db_int(0, "SELECT count(*) FROM forumstatus");
134 if( fses.n ){
135 int i = 0;
136 Stmt q;
137 db_prepare(&q,"SELECT label, value, descr FROM forumstatus"
138 " ORDER BY ord");
139 fses.aStatus = fossil_malloc(sizeof(fses.aStatus[0]) * fses.n);
140 while( SQLITE_ROW==db_step(&q) ){
141 ForumStatus * fs = &fses.aStatus[i++];
142 fs->zLabel = fossil_strdup(db_column_text(&q, 0));
143 fs->zValue = fossil_strdup(db_column_text(&q, 1));
144 fs->zDescr = fossil_strdup(db_column_text(&q, 2));
145 }
146 db_finalize(&q);
147 }
148 }
149 return &fses;
@@ -180,12 +177,11 @@
180 unsigned i;
181 db_find_and_open_repository(0,0);
182 fses = forum_statuses();
183 for(i = 0; i < fses->n; ++i ){
184 const ForumStatus * fs = &fses->aStatus[i];
185 fossil_print("Status: %!j %!j %!j\n",
186 fs->zValue, fs->zLabel, fs->zDescr);
187 assert( fs==forum_status_by_value(fs->zValue, 0) );
188 }
189 fossil_print("Total statuses: %u\n", i);
190 }
191
@@ -2232,11 +2228,11 @@
2232 ** unlimited but a limit may be imposed by the web server or a proxy.
2233 **
2234 ** SETTING: forum-statuses width=40 block-text
2235 ** This JSON5-formatted value defines an array of objects describing
2236 ** the available statuses of forum posts. Each entry of the array must
2237 ** be an object in the form {label:"X",value:"Y",description:"Z"}.
2238 ** The label is used in the UI and value becomes the value of the
2239 ** "status" tag on forum posts. Any forum post which has a status
2240 ** value which does not appear in this list is treated as if it had
2241 ** the first value from this list. If this setting is empty, is
2242 ** ill-formed JSON, or has only a single entry then the forum will
2243
--- src/forum.c
+++ src/forum.c
@@ -68,11 +68,10 @@
68 ** A single entry from the forum-statuses setting.
69 */
70 struct ForumStatus {
71 char *zLabel; /* Label for the UI */
72 char *zValue; /* status=X tag value */
 
73 };
74
75 /*
76 ** A list of ForumStatus objects.
77 */
@@ -113,37 +112,35 @@
112 ** list. A length-1 list is, for purposes of the UI, identical to
113 ** an empty one - status selection/filtering makes no sense if
114 ** there's only one choice. */
115 db_multi_exec(
116 "CREATE TEMP TABLE IF NOT EXISTS forumstatus("
117 " ord INTEGER PRIMARY KEY, label, value"
 
118 ");"
119 "DELETE FROM forumstatus;"
120 "INSERT INTO forumstatus(label,value)"
121 " WITH setting(v) AS ("
122 " SELECT value v FROM config WHERE name='forum-statuses'"
123 " ),"
124 " room(r) AS ("
125 " SELECT e.value FROM setting s, jsonb_each(s.v) e"
126 " WHERE json_valid(s.v, 0x02)"
127 " )"
128 " SELECT r->>'label', r->>'value'"
129 " FROM room;"
130 );
131 fses.n = (unsigned)db_int(0, "SELECT count(*) FROM forumstatus");
132 if( fses.n ){
133 int i = 0;
134 Stmt q;
135 db_prepare(&q,"SELECT label, value FROM forumstatus"
136 " ORDER BY ord");
137 fses.aStatus = fossil_malloc(sizeof(fses.aStatus[0]) * fses.n);
138 while( SQLITE_ROW==db_step(&q) ){
139 ForumStatus * fs = &fses.aStatus[i++];
140 fs->zLabel = fossil_strdup(db_column_text(&q, 0));
141 fs->zValue = fossil_strdup(db_column_text(&q, 1));
 
142 }
143 db_finalize(&q);
144 }
145 }
146 return &fses;
@@ -180,12 +177,11 @@
177 unsigned i;
178 db_find_and_open_repository(0,0);
179 fses = forum_statuses();
180 for(i = 0; i < fses->n; ++i ){
181 const ForumStatus * fs = &fses->aStatus[i];
182 fossil_print("Status: %!j %!j\n", fs->zValue, fs->zLabel);
 
183 assert( fs==forum_status_by_value(fs->zValue, 0) );
184 }
185 fossil_print("Total statuses: %u\n", i);
186 }
187
@@ -2232,11 +2228,11 @@
2228 ** unlimited but a limit may be imposed by the web server or a proxy.
2229 **
2230 ** SETTING: forum-statuses width=40 block-text
2231 ** This JSON5-formatted value defines an array of objects describing
2232 ** the available statuses of forum posts. Each entry of the array must
2233 ** be an object in the form {label:"X",value:"Y"}.
2234 ** The label is used in the UI and value becomes the value of the
2235 ** "status" tag on forum posts. Any forum post which has a status
2236 ** value which does not appear in this list is treated as if it had
2237 ** the first value from this list. If this setting is empty, is
2238 ** ill-formed JSON, or has only a single entry then the forum will
2239
+4 -5
--- www/forum.wiki
+++ www/forum.wiki
@@ -419,12 +419,12 @@
419419
<tt>forum-statuses</tt> is a JSON5-format array of objects in the
420420
following format:
421421
422422
<verbatim>
423423
[
424
- {label:"Open", value:"open", description:"Unresolved posts"},
425
- {label:"Resolved", value:"resolved", description:"Resolved posts"}
424
+ {label:"Open", value:"open"},
425
+ {label:"Resolved", value:"resolved"}
426426
...
427427
]</verbatim>
428428
429429
The list defines the legal statuses for forum posts and syncs with
430430
other project-level settings. All "label" and "value" members must be
@@ -447,10 +447,12 @@
447447
* The forum list shows the "label" value of the current status and
448448
a selection list of available filters. It elides the status column
449449
when filtering on a specific status.
450450
* The root of each thread, when selected, gets a new UI control for
451451
displaying or editing the status, depending on permissions.
452
+ * A drop-down selection list is added to the <tt>/forum</tt> page
453
+ for filtering based on the status.
452454
453455
A list with only a single entry is treated as empty, the justification
454456
being that if there is only one option then the UI does not need to be
455457
cluttered with it.
456458
@@ -468,12 +470,9 @@
468470
value of the first entry in the list.
469471
* The tag is applied only to the first version of any given post. The
470472
UI ensures that the tag is applied to the proper post, even when
471473
rendering a newer version.
472474
473
-The UI will eventually offer the ability to filter the post list by
474
-status.
475
-
476475
Caveat: a "closed" status is not recommended because it's easy to confuse with
477476
the <a href='#close-post'>"closed" tag feature</a>, which behaves considerably
478477
differently and predates that "status" tag support by about three years. The
479478
"closed" semantics cannot be trivially consolidated with those of "status".
480479
--- www/forum.wiki
+++ www/forum.wiki
@@ -419,12 +419,12 @@
419 <tt>forum-statuses</tt> is a JSON5-format array of objects in the
420 following format:
421
422 <verbatim>
423 [
424 {label:"Open", value:"open", description:"Unresolved posts"},
425 {label:"Resolved", value:"resolved", description:"Resolved posts"}
426 ...
427 ]</verbatim>
428
429 The list defines the legal statuses for forum posts and syncs with
430 other project-level settings. All "label" and "value" members must be
@@ -447,10 +447,12 @@
447 * The forum list shows the "label" value of the current status and
448 a selection list of available filters. It elides the status column
449 when filtering on a specific status.
450 * The root of each thread, when selected, gets a new UI control for
451 displaying or editing the status, depending on permissions.
 
 
452
453 A list with only a single entry is treated as empty, the justification
454 being that if there is only one option then the UI does not need to be
455 cluttered with it.
456
@@ -468,12 +470,9 @@
468 value of the first entry in the list.
469 * The tag is applied only to the first version of any given post. The
470 UI ensures that the tag is applied to the proper post, even when
471 rendering a newer version.
472
473 The UI will eventually offer the ability to filter the post list by
474 status.
475
476 Caveat: a "closed" status is not recommended because it's easy to confuse with
477 the <a href='#close-post'>"closed" tag feature</a>, which behaves considerably
478 differently and predates that "status" tag support by about three years. The
479 "closed" semantics cannot be trivially consolidated with those of "status".
480
--- www/forum.wiki
+++ www/forum.wiki
@@ -419,12 +419,12 @@
419 <tt>forum-statuses</tt> is a JSON5-format array of objects in the
420 following format:
421
422 <verbatim>
423 [
424 {label:"Open", value:"open"},
425 {label:"Resolved", value:"resolved"}
426 ...
427 ]</verbatim>
428
429 The list defines the legal statuses for forum posts and syncs with
430 other project-level settings. All "label" and "value" members must be
@@ -447,10 +447,12 @@
447 * The forum list shows the "label" value of the current status and
448 a selection list of available filters. It elides the status column
449 when filtering on a specific status.
450 * The root of each thread, when selected, gets a new UI control for
451 displaying or editing the status, depending on permissions.
452 * A drop-down selection list is added to the <tt>/forum</tt> page
453 for filtering based on the status.
454
455 A list with only a single entry is treated as empty, the justification
456 being that if there is only one option then the UI does not need to be
457 cluttered with it.
458
@@ -468,12 +470,9 @@
470 value of the first entry in the list.
471 * The tag is applied only to the first version of any given post. The
472 UI ensures that the tag is applied to the proper post, even when
473 rendering a newer version.
474
 
 
 
475 Caveat: a "closed" status is not recommended because it's easy to confuse with
476 the <a href='#close-post'>"closed" tag feature</a>, which behaves considerably
477 differently and predates that "status" tag support by about three years. The
478 "closed" semantics cannot be trivially consolidated with those of "status".
479

Keyboard Shortcuts

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