Modify

Opened 9 years ago

Last modified 5 years ago

#12424 new defect

BibAdd with attachment fails on pages which are not top level

Reported by: HMuentinga Owned by:
Priority: normal Component: TracBibPlugin
Severity: normal Keywords: patch
Cc: Trac Release:

Description

BibAdd fails e.g. in this case:

[[BibAdd(attachment:section/page/bib.bib]] yields Attachment 'wiki:section/page: bib.bib' does not exist..

Patch:

 1.0/tracbib/source.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/1.0/tracbib/source.py b/1.0/tracbib/source.py
index e48c5b1..77005b5 100644
--- a/1.0/tracbib/source.py
+++ b/1.0/tracbib/source.py
@@ -124,7 +124,7 @@ class BibtexSourceAttachment(Component):
         page = None
         file = arg[1]

-        path_info = arg[1].split('/', 1)  # greedy! split wikipath and filename
+        path_info = arg[1].rsplit('/', 1)  # greedy! split wikipath and filename

         if len(path_info) > 2:
             raise TracError('Usage: BibAdd(attachment:[path/to/]file)')

Attachments (0)

Change History (2)

comment:1 Changed 7 years ago by Ryan J Ollos

Owner: Roman Mohr deleted

comment:2 Changed 5 years ago by figaro

Keywords: patch added

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The ticket will remain with no owner.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.