Closed jwalits closed 2 years ago
@timhunt anything else we can do to get this over the line?
@brendanheywood warp space-time, so I get 25 hours in a day? ;-) Thanks for the gentle nudge. I will see if I can get to this today. Just kicked off the CI build.
hhmm, I think the behat failures are probably due the to moodle 4 nav changes
Agreed. Bonus marks if you do a fix, but that won't stop this getting reviewed and landing.
Another gentle bump
We've also got a bunch of plugins failing on 4.0 master and we'll likely have to just remove it from ci and cut new plugin branches to support it when it's actually stable. It's too much of a moving target at the moment.
OK, this implementation is a lot better. Thanks for sticking with this. But ...
if ($filearea === 'export')
bit.)So, to give an better aswer to @brendanheywood's question, "Anything else we can do to get this over the line?" You can review the code yourself, and work with your colleages to fix the issues before expecting me to spend more of my time on this.
Re 1) I guess we could take the view that this code is not going into Moodle core, and therefore it is acceptable to use the "Mixing pluginfile URLs and GET parameters" hack here. But, I think it is a hack, and what is going on needs to be documented with comments in the code.
1) Tim I'm not aware of any code standard for pluginfile urls forbidding get params, can you point me at the docs for this?
I'm not saying that any of these are correct but trawling the logs of a prod site shows many examples in core that do this already:
/pluginfile.php/###/course/section/###/essential-readings.png?time=###
/pluginfile.php/###/question/questiontext/###/Figure%###_##P.PNG?time=###
/pluginfile.php/###/mod_folder/content/#/Sample%##Video_Group%##Assignment_#.mp3?forcedownload=###
/pluginfile.php/###/mod_resource/content/###interactive/story.html?embed=###
I am not aware of anything else which does do this.
forcedownload
is a specific part of the file download system.
time
puzzles me. I expect something is adding that to make absolutely sure the file is not serverd from any web cache. However, I cannot find the code responsibile - which would hopefully reveal more about the intent.
I don't see any time
in our logs, Instead I see some rev=...
which is again clearly just about defeating caching, so I guess that time
is to do with your reverse proxy setup.
So, I am still feeling that this use of GET params is unprecidented - unless you keep searching and show me a real precident.
Hi @timhunt
Thank for the in-depth feedback. To address the points raised, I have made a new commit with the changes.
download_dataformat_selector
method. This adds the dataformat as a GET variable to the url. We also need to have the ability to pass in arbitrary number of parameters as defined by the user in the sql report. The code cannot assume, which value matches which key in the sql report if the pluginfile path contains for example /foo/bar/random/param
.make_pluginfile_url
method->out()
Please let us know if there is something else missing from the latest changes.
Thanks
Hi @timhunt
Wish you a very happy new year, hope you had an enjoyable break over Christmas and new years.
Just a gentle bump on this if you had a chance to review the new set of changes?
Thanks.
Finally. Sorry it too me so long to look at this (again!). But, all good now, and merged.
This PR addresses the points raised in #105