MDL-83661 core_courseformat: fix drop file modal

When the user drags and drops a file into a course section that can
create more than one type of activity (for example a zip file) the modal
had repeated form elements ids. Now every radio option has its own id.
This commit is contained in:
ferran
2024-11-08 11:46:05 +01:00
parent cd5c991ede
commit aab9e18b6d
3 changed files with 4 additions and 3 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -345,10 +345,11 @@ class HandlerManager {
let hasDefault = false;
fileHandlers.forEach((handler, index) => {
const isDefault = (defaultModule == handler.module);
const optionNumber = index + 1;
data.handlers.push({
...handler,
selected: isDefault,
labelid: `fileuploader_${data.uploadid}`,
labelid: `fileuploader_${data.uploadid}_${optionNumber}`,
value: index,
});
hasDefault = hasDefault || isDefault;