Skip to content
Snippets Groups Projects
Commit bfd8e0b4 authored by Dennis Grabowski's avatar Dennis Grabowski
Browse files

feat(patches): add first community patches

Because the H5P plugin team seems to be very slow, we should adopt a few
fixes/changes the community has implemented (and ideally even battle-
tested).

I devised the following concept based on a workflow I have seen in other
repositories (e.g. ´https://github.com/Frogging-Family/linux-tkg´).

We add pull requests or other fixes/changes as a single-patch file to a
folder (here: ´./patches´). This way, we can track what each changes
each fix needs, and are able to revert them easily, in case the official
H5P repo contains a fix in the future for one of the issues.
Because we could pull these changes from many different places, I would
suggest we use the following scheme for persistence:

´
./patches/gitProviderURL/gitUserOrOrganisationName/gitRepoName/pullRequestID-description.patch
´

So, for example, if we want to merge a patch from GitHub, from the user
´catalyst´ and the repo name ´moodle-mod_hvp´, it would look like this:

´
./patches/github.com/catalyst/moodle-mod_hvp/001-example-filename.patch
´

This way, we can easily track where we got the patches from without the
need to keep a list around.
This allows us also to check the pull requests in future for
discussions, i.e. are they still needed? did another
user find a better way to fix it? is the pull request merged or did the
H5P team reject it for some reason?

Our own patches should go either into the base ´./patches´ folder, or if
wished for, we create a ´HsH´ subfolder.

This commit contains two of these patches:
* Pull request #425: A fix for allowing H5P content in the mobile app
  without the need to allow frame embeddings globally
* Pull request #458: A fix for an ongoing resizing issue with embedded
  videos. This one seems to only fix embedded videos, sadly, as we are
  still plagued from other resizing issues.

Both fixes are pretty important IMHO to increase the h5p adoption of
both user groups (students, teachers).
parent 2876bde3
No related branches found
No related tags found
No related merge requests found
From 0d4b125d2266948f3d9200d6c2df6feff8599b31 Mon Sep 17 00:00:00 2001
From: Kevin Pham <keevan.pham@gmail.com>
Date: Wed, 18 Aug 2021 17:02:54 +1000
Subject: [PATCH] Fix checks to match with core handling for allowframeemedding
lib/weblib.php:2285 states that it only passes the 'X-Frame-Options: sameorigin' setting if embedding is disabled AND if the user is not loading the page from the app.
---
classes/output/mobile.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/classes/output/mobile.php b/classes/output/mobile.php
index 3a8f91f1..241bf0c8 100644
--- a/classes/output/mobile.php
+++ b/classes/output/mobile.php
@@ -27,7 +27,7 @@ public static function mobile_course_view($args) {
global $DB, $CFG, $OUTPUT, $USER;
$cmid = $args['cmid'];
- if (!$CFG->allowframembedding) {
+ if (empty($CFG->allowframembedding) && !\core_useragent::is_moodle_app()) {
$context = \context_system::instance();
if (has_capability('moodle/site:config', $context)) {
$template = 'mod_hvp/iframe_embedding_disabled';
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment