This fix would allow people to specify the URL use to retrieve file attachments

Embedding MoinMoin into another application is not a difficult process, but sometimes the relative pathing can become incorrect because of this embedding

Currently, the AttachFile.getAttachURL retrieves the URL prefix from the function env.get. This is fine for the regular distribution of MoinMoin, but not for what I am doing with it. The issue arises when env.get returns a "." and the relative path becomes incorrect. I am only having this issue with attachments and only while in the graphical editor.

While this would not be terribly useful for other users, it could be implemented with no consequences to those users.

A default URL of "." could be added to the configuration file. If the user is doing something interesting with MoinMoin and required this functionality, they could specify it themselves. The only other change would be in AttachFile.getAttachURL. The call to get the script url would be replaced with a call to obtain the URL out of the config, as seen below:

AttachFile.getAttachUrl:

url = "%s/%s?action=%s&do=get&target=%s" % (
      request.cfg.attachmentURL, wikiutil.quoteWikinameURL(pagename), action_name, wikiutil.url_quote_plus(filename)) 


Please provide more details (and samples) why you need this change. We use request.getScriptname() at many other places, not only in getAttachUrl(). -- ThomasWaldmann 2006-06-19 07:22:47


CategoryFeatureRequest

MoinMoin: FeatureRequests/AttachmentURLPrefix (last edited 2007-10-29 19:14:31 by localhost)