diff --git a/controllers/administration.js b/controllers/administration.js index e303173ad4..ff03d04d95 100644 --- a/controllers/administration.js +++ b/controllers/administration.js @@ -960,7 +960,7 @@ router.get( '/teachers/:id/edit', permissionsHelper.permissionsChecker(['ADMIN_VIEW', 'TEACHER_EDIT'], 'or'), (req, res, next) => { - const userPromise = api(req).get(`users/admin/teachers/${req.params.id}`); + const userPromise = api(req, { version: 'v3' }).get(`users/admin/teachers/${req.params.id}`); const classesPromise = getSelectOptions(req, 'classes', { $populate: ['year'], $sort: 'displayName', @@ -1119,7 +1119,7 @@ router.get( '/students/:id/skipregistration', permissionsHelper.permissionsChecker('STUDENT_SKIP_REGISTRATION'), (req, res, next) => { - api(req).get(`/users/admin/students/${req.params.id}`) + api(req, { version: 'v3' }).get(`/users/admin/students/${req.params.id}`) .then((user) => { res.render('administration/users_skipregistration', { title: res.$t('administration.controller.link.toGiveConsent'), @@ -1165,7 +1165,7 @@ router.get( $skip: itemsPerPage * (currentPage - 1), }; query = Object.assign(query, filterQuery); - api(req) + api(req, { version: 'v3' }) .get('/users/admin/students', { qs: query, }) @@ -1288,13 +1288,14 @@ const getUsersWithoutConsent = async (req, roleName, classId) => { const batchSize = 50; while (users.length > 0) { usersWithMissingConsents.push( - ...(await api(req).get('/users/admin/students', { + ...(await api(req, { version: 'v3' }).get('/users/admin/students', { qs: { users: users .splice(0, batchSize) .map((u) => u._id), - consentStatus: ['missing', 'parentsAgreed'], + consentStatus: { $in: ['missing', 'parentsAgreed'] }, $limit: batchSize, + $sort: { 'lastName': 1}, }, })).data, ); @@ -1400,7 +1401,7 @@ router.get( '/students/:id/edit', permissionsHelper.permissionsChecker(['ADMIN_VIEW', 'STUDENT_EDIT'], 'or'), (req, res, next) => { - const userPromise = api(req).get(`/users/admin/students/${req.params.id}`); + const userPromise = api(req, { version: 'v3' }).get(`/users/admin/students/${req.params.id}`); const accountPromise = api(req, { json: true, version: 'v3' }) .get('/account', { qs: { type: 'userId', value: req.params.id }, diff --git a/static/scripts/topicEdit.js b/static/scripts/topicEdit.js index 1865c3b438..b930666340 100644 --- a/static/scripts/topicEdit.js +++ b/static/scripts/topicEdit.js @@ -1065,7 +1065,7 @@ class TopicH5P extends TopicBlock { const { parentType, parentId } = this.props; const editorPopup = window.open( - `/h5p/editor/${id ?? ''}?parentType=${parentType}&parentId=${parentId}&inline=1`, + `/h5p/editor/${id ?? 'new'}?parentType=${parentType}&parentId=${parentId}&inline=1`, 'h5p-editor', `width=${w}, height=${h}, left=${x}, top=${y}, fullscreen=yes, toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=yes`,