I have to believe this is a dupe, since it's a pretty obvious UI issue, but I couldn't find it anywhere. Apologies in advance if this has been covered somewhere.
BTW, running 7.8 on a WAMP testbed.
Subject pretty much says it. For example, I have an Imagefield and a File field.
For the file field, if I try to use the token [current-page:title] it will give me a token like
Edit PageName of Page
This will attempt to create the save path
public://node/73/edit.Edit Page Name of Page
That will, of course, fail. If instead, I use [current-page:url:alias] it creates the path
http://localhost/sites/default/files/node/73/edit/filename.ext
In other words, it takes "current page" to mean the edit screen, whereas wouldn't most people want this to be the node itself and wouldn't most people expect this token to be the alias for the node, not the (non-existent) token for the edit screen?
So it seems like ideally there would be cleanup of path tokens based on the values for the underlying node, rather than for the edit screen.
Comments
Comment #1
ergophobe commentedI can get the node alias by using the Filefield Paths module, by the way and that works pretty well (though it is unmaintained).
Nevertheless, I think the "current-page" output at least in this context should be cleaned so that the tokens at least make valid URLs. That is perhaps something that should happen on the Filefield side not the Token side, so perhaps this should be filed under "file system."
Comment #2
dave reidThe current page token is working exactly as designed - it is the current page only. Core also does not provide enough context to use node tokens for file upload paths unless you have the filefield_paths module installed. That is the only way.