Skip to content

H5P button is not available for atto editor when using textarea customfield #137

@TomoTsuyuki

Description

@TomoTsuyuki

H5P button is not available for atto editor when using textarea customfield

How to replicate:

  • Create a cms content type with textarea customfield
  • Create a course
  • Create a cms content using the cms content type with text area customfield
  • Enrol a teacher
  • Login by the teacher account (not using "login as" function)
  • Edit the cms activity
  • The customfield editor doesn't have H5P button for the teacher. (It's available for admin)

The issue is the text editor (TinyMCE / Atto) is loaded by the system context, which teacher role doesn't have capability for loading H5P button.

Textarea using $this->get_handler()->get_configuration_context();, which returns system context.
https://github.com/moodle/moodle/blob/ec7711b9a60402891db61357f914be161bc3dfbe/customfield/field/textarea/classes/field_controller.php#L115

return \context_system::instance();

The context should be from instance context, not system context.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions