fixes problem with attachment's link

Currently when I upload/select an attachment the link that is produced has an href="javascript:void(0)/*201*/" that does not work.

This commit fixes that and uses the correct href.