instance is has been used instead of cmid. This works as all id's are 1
in most cases, but not always.
accesslib_clear_all_caches_for_unit_testing was updated to clear the
$USER->access cache which would fail test when the wrong user's data was used.
This includes a check to see if there are 0 pages in the combined pdf,
catching exceptions and suppressing php warnings and errors from bad pdf files.
Also - Use TCPDF directly to check if pdfs are compatible. The previous check was
letting dodgy PDFs through which then failed at generation time. This way dodgy
pdfs will get run through ghostscript early and cleaned up.
This patch adds a new performance metric to the performance
info shown by MDL_PERF* vars, the time spent by the database,
it was one of the wonderful @poltawski ideas. To be more specific
the value displayed is the sum of the time elapsed between query_start()
and query_end().
It includes 2 more minor fixes:
- Escapes values sent to TinyMCE as it was breaking
when values contained double quotes.
- Adding seconds to the screenshots directory to
avoid using the same folder for multiple runs.
This was breaking with oracle master/master replication. Fortunately all
the places that needed to be changed were private to datalib.php. There
is still some ordering by id there, but only places where we want a
consitent, rather than meaningful, order, so that is OK.
The queries changed by this patch all have subqueries in aggregate
queries that pull out the latest step for a question_attempt. Those
queries used to look for MAX(id) but now they look for
MAX(sequencenumber). This is equivalent (for databases where ids always
increase with time, except for auto-saved steps. In the past, an
auto-saved step might have been considered latest. Now the latest step
will always be one that has been properly processed. You can aruge that
this change is an improvement. Anyway, it is a moot point. All these
queries are only used in reports which are run on completed attempts,
where there will not be any autosaved data.
This reverts commit ed3d1ee60d1e48ade21438fd98fef2deb63ecb5f.
This reverts commit ed8eebeecefa98e17c96084b72fe2cd923cc051d.
This reverts commit f664a9387818b5b359df4696040da0aea07b926a.
This reverts commit 9d2276572372f5d249cde8c61d0976e25f0fa4a8.
This test was doing work which doesn't make sense as a unit test.
Perhaps the most sensible option would be to use a git hook. Here is
a replacement David Mudrák created:
$ cat .git/hooks/pre-commit
#!/bin/bash
FOUND=$(git diff-index --cached -U0 HEAD -- | grep DONOTCOMMIT | wc -l)
if [[ $FOUND -gt 0 ]]; then
echo "pre-commit hook: DONOTCOMMIT detected, commit not allowed"
exit 1
fi
The restore cleanup code expects the mtime to be the time of extraction
not the mtime before archiving. If set to the old mtime, the restore
files may be cleaned up before the restore is complete.
This behaviour also matches the behaviour of the zip unpacker.