[Pmwiki-users] SideBar Woes

Benedikt Hochstrasser bhoc
Wed Jun 16 15:03:01 CDT 2004


When you have an attachment (ie an image) in the sidebar, then 
each time you upload another attachment, you get the filename 
of the last SideBar image as the suggested file name.

Try this:
- take a vanilla PmWiki 1.0.0 version
- enable uploads
- edit Main.SideBar and append "Attach:test.jpg" to it.
- edit Main.HomePage and append "Attach:foo.gif" there.
- You'll get two question marks for each of the to-be-uploaded files.
- Click on the question mark to the right of "Attach:foo.gif".
- In the upload form, "Name attachment as:" is set to "test.jpg".

I assume this is because the Sidebar is loaded first, dealt with the
embedded attachment there, and overwriting the $upname
variable in the query string.

Note: this is also the case when eg "test.jpg" actually exists.
It's just annoying, but it took me quite a while to track down.

A quick workaround consists in replacing "$uploadname" with
"$upname" in upload.php, lines 53 and 59. However, I am not
sure what the side-effects of this hack are.

-- 
Ben




More information about the pmwiki-users mailing list