Skip to content

Commit c2338b3

Browse files
committed
Apply update to cms types that use "fields"
1 parent 14311bb commit c2338b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

db/upgrade.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,9 @@ function xmldb_cms_upgrade($oldversion) {
422422
$sql = "SELECT f.*, ctx.id as ctxid
423423
FROM {files} f
424424
JOIN {customfield_data} cfd ON cfd.id = f.itemid
425-
JOIN {customfield_field} cff ON cff.id = cfd.fieldid AND cff.shortname = 'overview'
425+
JOIN {customfield_field} cff ON cff.id = cfd.fieldid
426426
JOIN {cms} cms ON cms.id = cfd.instanceid
427+
JOIN {cms_types} cmst ON cmst.id = cms.typeid AND cmst.datasources LIKE '%fields%'
427428
JOIN {course_modules} cm ON cm.instance = cms.id
428429
JOIN {modules} m ON m.id = cm.module AND m.name = 'cms'
429430
JOIN {context} ctx ON ctx.instanceid = cm.id AND ctx.contextlevel = :modulecontextlevel

0 commit comments

Comments
 (0)