|Title|Links to non-existent attachments are not outlined red
|Date|07-Sep-2006 00:46:25 EEST
|Submitter|Candid Dauth
|[Bug criticality]|LightBug
|Browser version|Opera/9.01
|[Bug status]|NewBug
|[PageProvider] used|VersioningFileProvider
|Servlet Container|tomcat-5.5
|Operating System|GNU/Linux
|Java version|sun-jdk-1.5

See the colours of these links:
* [Main] – page does exist (correct behaviour)
* [Husseldiguggeldu] – page does not exist (correct behaviour)
* [attach.txt] – attachment does not exist (correct behaviour)
* [BrushedTemplate/brushed-v2.4.x.zip] – attachment does exist on other page (correct behaviour)
* [BrushedTemplate/husseldiguggeldu.txt] – attachment does not exist on other page (should be red)
* [Husseldiguggeldu/attach.txt] – attachment does not exist, nor does its page (should be red)


The reason attach.txt is red is because JSPWiki thinks its a WikiPage that needs to be created. 

Only non-existant WikiPages are red because when JSPWiki parses a page with links, it checks if the page exists or not. If not, then it creates an edit link with a class='editpage' attribute.

For attachments, JSPWikiMarkupParser does try and find the attachment; however, don't know why this is there:

JSPWikiMarkupParser.java -> findAttachment() -> line 1426

else if( link.indexOf('/') != -1 )
    return link;

I believe that this would mean that if any link created has a '/' in it, it creates an attachment link, even if the attachment does not exist.

If you were to get rid of this line, you'd have to check in the attachment is null in handleHyperlinks() and then have another case in makeLink()
that handles non-existant attachments. 

This is not necessarily a bug, but maybe more like an enhancement request.

--AlexReid, 07-Sep-2006


[Waiting for volunteer to fix this bug|BugsPendingVolunteer]

--HarryMetske, 21-Mar-2007