The new recordset support for Postgres requires transactions and
will cause errors if recordsets are not closed correctly. This
commit fixes problems that were identified during unit tests, and
via some basic code analysis, across all core code. Most of these
are incorrect usage of recordset (forgetting to close them).
dirname() is a slow function compared with __DIR__ and using
'/../'. Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code. This allows those required includes to perform as
best as possible in this situation.
When a checkbox is not checked, it does not submit in the form, therefore
this must be an !empty() test instead of an (int) casting.
This issue is a part of the MDL-47194 Task.
This issue is a part of the MDL-39707 Epic.