Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
TomoTsuyuki opened this issue Nov 1, 2024 · 0 comments

Comments

@TomoTsuyuki
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant