mirror of
https://github.com/moodle/moodle.git
synced 2025-08-07 18:06:51 +02:00
Merge branch 'MDL-69687-m39' of https://github.com/sammarshallou/moodle into MOODLE_39_STABLE
This commit is contained in:
commit
565bc965b1
4 changed files with 15 additions and 3 deletions
|
@ -2589,5 +2589,16 @@ function xmldb_main_upgrade($oldversion) {
|
|||
upgrade_main_savepoint(true, 2020061501.11);
|
||||
}
|
||||
|
||||
if ($oldversion < 2020061502.09) {
|
||||
// Delete orphaned course_modules_completion rows; these were not deleted properly
|
||||
// by remove_course_contents function.
|
||||
$DB->delete_records_subquery('course_modules_completion', 'id', 'id',
|
||||
"SELECT cmc.id
|
||||
FROM {course_modules_completion} cmc
|
||||
LEFT JOIN {course_modules} cm ON cm.id = cmc.coursemoduleid
|
||||
WHERE cm.id IS NULL");
|
||||
upgrade_main_savepoint(true, 2020061502.09);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2007,7 +2007,7 @@ abstract class moodle_database {
|
|||
* @param string $subquery Subquery that will return values of the field to delete
|
||||
* @param array $params Parameters for subquery
|
||||
* @throws dml_exception If there is any error
|
||||
* @since Moodle 3.10
|
||||
* @since Moodle 3.9.3
|
||||
*/
|
||||
public function delete_records_subquery(string $table, string $field, string $alias,
|
||||
string $subquery, array $params = []): void {
|
||||
|
|
|
@ -5293,6 +5293,7 @@ function remove_course_contents($courseid, $showfeedback = true, array $options
|
|||
if ($cm->id) {
|
||||
// Delete cm and its context - orphaned contexts are purged in cron in case of any race condition.
|
||||
context_helper::delete_instance(CONTEXT_MODULE, $cm->id);
|
||||
$DB->delete_records('course_modules_completion', ['coursemoduleid' => $cm->id]);
|
||||
$DB->delete_records('course_modules', array('id' => $cm->id));
|
||||
rebuild_course_cache($cm->course, true);
|
||||
}
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// You should have received a copy of the GNU General Public Licensáe
|
||||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
/**
|
||||
|
@ -29,7 +29,7 @@
|
|||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$version = 2020061502.08; // 20200615 = branching date YYYYMMDD - do not modify!
|
||||
$version = 2020061502.09; // 20200615 = branching date YYYYMMDD - do not modify!
|
||||
// RR = release increments - 00 in DEV branches.
|
||||
// .XX = incremental changes.
|
||||
$release = '3.9.2+ (Build: 20201016)'; // Human-friendly version name
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue