Skip to content

Custom fields data is stored on system context  #121

Description

@dmitriim

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions