[pmwiki-users] attachlist bug or feature? (third posting)
Curtis, Clayton
Clayton.Curtis at va.gov
Thu Apr 27 14:56:54 CDT 2006
On 4/26/06, Neil Herber <nospam at eton.ca> wrote:
> The list was silent on my first 2 attempts, so I will ask again. Can
> *anyone* can shed some light on this problem?
>
> The (:attachlist:) docs don't explain all of the options - at least
> not all in the same place. I believe the syntax is:
>
> (:attachlist [Name] [ext=xyz]:)
>
On 4/26/06, Hagan wrote:
>I wonder what would happen if you switched to
> $UploadPrefixFmt = '/$Group/$Name'; for specifying per-page attachments.
I'm using that, and the behavior is not affected.
> It appears to be a bug. Try attaching a file to a page with a name
> that's not a wikiword and I think you'll see the behavior you expect
> for that page, but not for pages with names that are wikiwords.
Hagan crystalized it well, but here are the results of formal testing.
I set up Test.HomePage, Test.Homepage, Test.NewOne, Test.Newone, and Test.NewTwo (in order to be able to look at the others from outside).
Each except the last had a single attachment with a filename that reflected the enclosing directory with the same case. (E.g., Test.HomePage had Test_HomePage.txt, etc.)
I pasted in the results below, but here's the summary:
- The [Name] parameter is interpreted as follows:
a. If represented as <XXXX>, try to find <XXXX>.HomePage (case-specific), and if that doesn't exist, try <currentgroup>.<XXXX>
b. If represented as <XXXX>.<YYYY> look for <group XXXX>.<page YYYY>
- All instances where [Name] is interpreted as a page OR A GROUP fail when [Name] is a wikiword.
I don't have the php skills to try to figure out where the code is or why it fails. Someone will have to determine if this is a result of a 'feature' involving normalization of names.
Sorry for the long post.
Clayton Curtis
(:attachlist:)
<attachment(s) of current page>
- none in my test case>
(:attachlist Test.HomePage:)
<nothing>
- bug, since an attachment existed
(:attachlist Test.Homepage:)
Test_Homepage.txt Δ ... 108 bytes ... April 27, 2006, at 11:39 AM
- correct, working for page name not a wikiword
(:attachlist Test.NewOne:)
<nothing>
- bug, since an attachment existed
(:attachlist Test.Newone:)
Test_Newone.txt Δ ... 108 bytes ... April 27, 2006, at 11:41 AM
- correct, working for page name not a wikiword
(:attachlist Test:)
Test_HomePage.txt Δ ... 108 bytes ... April 27, 2006, at 11:28 AM
- shows that "Test" was taken as a group name, and that "HomePage" was added on, AND that the correct attachment was found, indicating that nothing was done to the literal name "HomePage".
(:attachlist HomePage:)
<nothing>
- bug, since an attachment existed, as just shown; indicates that something was done to the specified name before looking for attachments (i.e., enclosing directory of the specified name)
(:attachlist Homepage:)
Test_Homepage.txt Δ ... 108 bytes ... April 27, 2006, at 11:39 AM
- correct, working for page name not a wikiword
(:attachlist NewOne:)
<nothing>
- bug, since an attachment existed
(:attachlist Newone:)
Test_Newone.txt Δ ... 108 bytes ... April 27, 2006, at 11:41 AM
- correct, working for page name not a wikiword
Special tests:
(:attachlist Test.Main:)
Test_Main_nopage.txt Δ ... 108 bytes ... April 27, 2006, at 03:18 PM
- correct, though this was a case where no page actually existed; I just populated an appropriately named directory.
(:attachlist Main:)
Doc1.txt Δ ... 14 bytes ... April 27, 2006, at 03:15 PM
Doc2.txt Δ ... 14 bytes ... April 27, 2006, at 03:15 PM
- correct, but demonstrates that the parameter is evaluated as a group name first, with "HomePage" added on the end (since the files were in uploads/Main/HomePage and they showed up rather than the file in uploads/Test/Main)
(:attachlist Main.HomePage:)
- bug, since files exist there, as shown immediately above
(:attachlist Main.VistAPapers:)
- bug, just using another wikiword page name; a file actually exists in uploads/Main/VistAPapers
(:attachlist TestTwo:)
<nothing>
- bug, there is a file in /uploads/TestTwo/HomePage
(:attachlist TestTwo.Page:)
<nothing>
- bug, there is a file in /uploads/TestTwo/Page
More information about the pmwiki-users
mailing list