Fossil SCM

Correct /artifact/ATTACHMENT_ID to distinguish forum post attachments from wiki page attachments.

stephan 2026-05-22 16:48 UTC forum-attachments
Commit 19506538a50fb334f970e2766dc37008a97ce262afd3b71740f5bcb2f04d1b12
2 files changed +1 +7 -1
--- src/attach.c
+++ src/attach.c
@@ -26,10 +26,11 @@
2626
** List attachments.
2727
**
2828
** tkt=HASH
2929
** page=WIKIPAGE
3030
** technote=HASH
31
+** forumpost=HASH
3132
**
3233
** At most one of technote=, tkt= or page= may be supplied.
3334
**
3435
** If none are given, all attachments are listed. If one is given, only
3536
** attachments for the designated technote, ticket or wiki page are shown.
3637
--- src/attach.c
+++ src/attach.c
@@ -26,10 +26,11 @@
26 ** List attachments.
27 **
28 ** tkt=HASH
29 ** page=WIKIPAGE
30 ** technote=HASH
 
31 **
32 ** At most one of technote=, tkt= or page= may be supplied.
33 **
34 ** If none are given, all attachments are listed. If one is given, only
35 ** attachments for the designated technote, ticket or wiki page are shown.
36
--- src/attach.c
+++ src/attach.c
@@ -26,10 +26,11 @@
26 ** List attachments.
27 **
28 ** tkt=HASH
29 ** page=WIKIPAGE
30 ** technote=HASH
31 ** forumpost=HASH
32 **
33 ** At most one of technote=, tkt= or page= may be supplied.
34 **
35 ** If none are given, all attachments are listed. If one is given, only
36 ** attachments for the designated technote, ticket or wiki page are shown.
37
+7 -1
--- src/info.c
+++ src/info.c
@@ -1872,11 +1872,17 @@
18721872
}else{
18731873
@ Attachment "%h(zFilename)" to
18741874
}
18751875
objType |= OBJTYPE_ATTACHMENT;
18761876
if( fossil_is_artifact_hash(zTarget) ){
1877
- if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'",
1877
+ if( forumpost_head_rid2(zTarget)>0 ){
1878
+ if( g.perm.Hyperlink && g.anon.RdForum ){
1879
+ @ forum post [%z(href("%R/forumpost/%!S",zTarget))%S(zTarget)</a>]
1880
+ }else{
1881
+ @ forum post [%S(zTarget)]
1882
+ }
1883
+ }else if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'",
18781884
zTarget)
18791885
){
18801886
if( g.perm.Hyperlink && g.anon.RdTkt ){
18811887
@ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>]
18821888
}else{
18831889
--- src/info.c
+++ src/info.c
@@ -1872,11 +1872,17 @@
1872 }else{
1873 @ Attachment "%h(zFilename)" to
1874 }
1875 objType |= OBJTYPE_ATTACHMENT;
1876 if( fossil_is_artifact_hash(zTarget) ){
1877 if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'",
 
 
 
 
 
 
1878 zTarget)
1879 ){
1880 if( g.perm.Hyperlink && g.anon.RdTkt ){
1881 @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>]
1882 }else{
1883
--- src/info.c
+++ src/info.c
@@ -1872,11 +1872,17 @@
1872 }else{
1873 @ Attachment "%h(zFilename)" to
1874 }
1875 objType |= OBJTYPE_ATTACHMENT;
1876 if( fossil_is_artifact_hash(zTarget) ){
1877 if( forumpost_head_rid2(zTarget)>0 ){
1878 if( g.perm.Hyperlink && g.anon.RdForum ){
1879 @ forum post [%z(href("%R/forumpost/%!S",zTarget))%S(zTarget)</a>]
1880 }else{
1881 @ forum post [%S(zTarget)]
1882 }
1883 }else if ( db_exists("SELECT 1 FROM tag WHERE tagname='tkt-%q'",
1884 zTarget)
1885 ){
1886 if( g.perm.Hyperlink && g.anon.RdTkt ){
1887 @ ticket [%z(href("%R/tktview?name=%!S",zTarget))%S(zTarget)</a>]
1888 }else{
1889

Keyboard Shortcuts

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