Despite mod_cms custom fields are saved in activity/course context, it's always set as system see https://github.com/catalyst/moodle-mod_cms/blob/main/classes/customfield/cmsfield_handler.php#L60
This creates issues with file processing and permission checking.
E.g. After https://tracker.moodle.org/browse/MDL-79256 has been landed, even if a user has moodle/site:trustcontent capability in a course context, it's still set a field content to not trusted and some tags (e.g. iframes) are stripped.
The fix for this issue should also update context id for existing fields in mdl_customfield_data. Potentially figure out context from instanceid.
Despite mod_cms custom fields are saved in activity/course context, it's always set as system see https://github.com/catalyst/moodle-mod_cms/blob/main/classes/customfield/cmsfield_handler.php#L60
This creates issues with file processing and permission checking.
E.g. After https://tracker.moodle.org/browse/MDL-79256 has been landed, even if a user has moodle/site:trustcontent capability in a course context, it's still set a field content to not trusted and some tags (e.g. iframes) are stripped.
The fix for this issue should also update context id for existing fields in mdl_customfield_data. Potentially figure out context from instanceid.