We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36516
    • 179 Posts
    A bug I first saw years ago I've just rediscovered in v2.2.11 while attempting to explain to someone how to add PDF download links to a menu. It turns out you can drop files into any field other than "Weblink" (the one you're actually going to want to drop in to) and get the full path from root. Drop into "Weblink" and all you get is "undefined".

    Well, I've just tried it in 2.4.1 and it still doesn't work! How is this not a big problem that should have been fixed years ago? How do people make links to uploaded files without tripping over this!?

    I could have sworn I got into a discussion in this forum way back when, and vaguely recall someone saying this behaviour might have been inexplicably "by design", but it's so rediculous and I can't find evidence of the discussion so I'm bringing it up again. Yeah, I realised if it's a bug I should report it as such, but as it has been around all this time I don't want to assume anything, so perhaps someone else can confirm the problem.

    To compound the issue, it seems impossible to get the full file path out of Modx. Editing the file gives filename and path fields, but only relative to the FILES media source. I've set my FILES tab to default to the 'assets/' folder so people won't upload stuff into the root of the site, so now it's impossible for them to see at a glance where the file actually lives, or even copy/paste the URL. Dragging and dropping seems like the way to do it, but of course it doesn't work, and evidently hasn't since forever.

    For the purposes of this issue let's assume I'm aware that Static Resources might be a better solution, depending on the context. In this case I'm concerned with keeping the same link but pointing it at different files occasionally.
      • 36516
      • 179 Posts
      Actually having thought this through some more I realise that Static Resources seem to have been designed for this very purpose, and even offer a file browser button for finding items to "link" to. But in spite of this, being unable to drag and drop files into a weblink field when you can in fact drop them into the "desciption" field immediately above, is really very silly.