Fossil SCM
Fix a bug in tech-note editing that was generating an invalid artifact. This check-in fixes the bug, but tech-notes still need work. There ought to be a safety mechanism that checks to ensure that the new artifact does parse correctly before it is committed, for example.
Commit
c123e3aa075522cc658accbc5b285924a6c0ce30
Parent
8006c6ddf25d3f5…
1 file changed
+6
+6
| --- src/event.c | ||
| +++ src/event.c | ||
| @@ -267,10 +267,16 @@ | ||
| 267 | 267 | rid = db_int(0, |
| 268 | 268 | "SELECT rid FROM tagxref" |
| 269 | 269 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname GLOB '%q*')" |
| 270 | 270 | " ORDER BY mtime DESC", zTag |
| 271 | 271 | ); |
| 272 | + if( rid && strlen(zId)<40 ){ | |
| 273 | + zId = db_text(0, | |
| 274 | + "SELECT substr(tagname,7) FROM tag WHERE tagname GLOB '%q*'", | |
| 275 | + zTag | |
| 276 | + ); | |
| 277 | + } | |
| 272 | 278 | free(zTag); |
| 273 | 279 | |
| 274 | 280 | /* Need both check-in and wiki-write or wiki-create privileges in order |
| 275 | 281 | ** to edit/create an event. |
| 276 | 282 | */ |
| 277 | 283 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -267,10 +267,16 @@ | |
| 267 | rid = db_int(0, |
| 268 | "SELECT rid FROM tagxref" |
| 269 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname GLOB '%q*')" |
| 270 | " ORDER BY mtime DESC", zTag |
| 271 | ); |
| 272 | free(zTag); |
| 273 | |
| 274 | /* Need both check-in and wiki-write or wiki-create privileges in order |
| 275 | ** to edit/create an event. |
| 276 | */ |
| 277 |
| --- src/event.c | |
| +++ src/event.c | |
| @@ -267,10 +267,16 @@ | |
| 267 | rid = db_int(0, |
| 268 | "SELECT rid FROM tagxref" |
| 269 | " WHERE tagid=(SELECT tagid FROM tag WHERE tagname GLOB '%q*')" |
| 270 | " ORDER BY mtime DESC", zTag |
| 271 | ); |
| 272 | if( rid && strlen(zId)<40 ){ |
| 273 | zId = db_text(0, |
| 274 | "SELECT substr(tagname,7) FROM tag WHERE tagname GLOB '%q*'", |
| 275 | zTag |
| 276 | ); |
| 277 | } |
| 278 | free(zTag); |
| 279 | |
| 280 | /* Need both check-in and wiki-write or wiki-create privileges in order |
| 281 | ** to edit/create an event. |
| 282 | */ |
| 283 |