Hi Susan,
Can you give me some more information on this error? Which line is causing the error?
-
☆ A M B ☆
- 24,524 Posts
I don’t know. All that I know is that in older versions of MODx the file downloads worked. In 3.2 the files would be corrupted; I had to make a separate download script and the "download.php" and "checkout.php" simply redirected to that .php file.
Originally, the download.php file was included by the app’s main docman.php file, much the same as the Manager works with the /manager/index.php file, acting as a "switchboard". So the download was being initiated from a page that had been through the parser. In 3.2, the downloads were corrupted.
When I redirect to a .php file that does the download without being passed through the parser, the download is fine.
Now that I know more about events, I think I can get a look at the parsed file and see what the parser is doing to the download headers. That has to be the problem; something is changing the headers in the parsing. I’m using the exact same function, full of header statements, to initiate the download as I was before; it’s just not going through the parser now.
-
MODX Staff
- 12,272 Posts
This may also be loosely related to what’s adding (or not removing) the extra backslashes in the Newspublisher/Newslister stuff too.
Ryan Thrash, MODX Co-Founder
Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
-
☆ A M B ☆
- 24,524 Posts
I’ll work with it today, and see what I can find out.
-
☆ A M B ☆
- 24,524 Posts
Very interesting. I wrote a plugin that intercepted the OnWebPagePrerender event, and had it write the parsed page to disk if the document was the docman page and the "download" button had been clicked. Everything looked normal, the page was normal. Then I replaced download.php with the old version, which runs the download headers through the parser, and this is the result:
Wow, I can’t even post the garbage! Here’s a screen capture of part of the text file. Anyway, everything that is generated by the snippet from the downloads.php file is garbage. The file category menu, generated from the menu.php file, is fine, as is everything else from the MODx template itself. Before clicking on "download" it’s fine; if I refresh the page after clicking "download" it will display the garbage briefly over the parts of the page that render correctly, then finish downloading the page from the server and the garbage disappears.