Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
There is an error in H5P.SoundJS-1.0 that is exposed by various js minimization functions whether advagg or even Drupal core js aggregation.
This line has an error...
a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[./]*?\//i,a.EXTENSION_PATT=/\/?[^/]+\.(\w{1,5})$/i
and should instead escape the two bracketed / like this...
a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i
How do we fix that? I think H5P.SoundJS-1.0 is just a utility library used by other libraries.
Comments
Comment #2
webservant316 CreditAttribution: webservant316 commentedOkay looks like a problem with jsmin on the H5P content types Interactive Chart and Interactive Multiple Choice. I will be looking for a way to turn off AdvAgg on H5P content types as a solution.
Any other ideas?
Comment #3
paalj CreditAttribution: paalj commentedIt would be interesting to know:
- Which JavaSscript errors you see
- Which files jsmin are messing up
Comment #4
webservant316 CreditAttribution: webservant316 commentedHow do I get that information from the failed page? I am using FF with Firebug installed. Will that help?
Comment #5
webservant316 CreditAttribution: webservant316 commentedTemporary solution over here https://www.drupal.org/node/2803335.
Comment #6
paalj CreditAttribution: paalj commentedIn Firefox you should select Tools -> Web Developer -> Web Console (from the menu bar), and see if there are any errors displayed. If so, please paste them here.
Comment #7
webservant316 CreditAttribution: webservant316 commentedWhen using jsmin on Interactive chart
When using jsmin on Interactive Multiple Choice
Comment #8
paalj CreditAttribution: paalj commentedI had hoped the error message would give a clue about what is wrong, but unfortunately that was not the case.
Since you have found a solution to this, and it is not related to the H5P module (but one or moer of the H5P content types), I suggest you close this issue.
Comment #9
webservant316 CreditAttribution: webservant316 commentedI am no longer using project/advagg and now still have the same problem with the native Drupal Js aggregator. I am thinking there is a bug in some H5P Js.
I will private message the maintainer a webpage that demonstrates the problem.
Comment #10
paalj CreditAttribution: paalj commentedI have taken a look at the files you sent, and it seems the aggregation fails for h5p-soundjs. I get "Uncaught SyntaxError: Invalid regular expression: missing /" in the console, and see that parts of soundjs is gone.
We have no problems with this on h5p.org, which is using the native Drupal aggrgation. Are you using the latest Drupal version?
Comment #11
webservant316 CreditAttribution: webservant316 commentedYes, I am using Drupal 7.56 and jQuery_update 7.x-2.7 with the jquery version set to 1.8.
Comment #12
webservant316 CreditAttribution: webservant316 commentedanything else I can provide to debug this problem?
Comment #13
webservant316 CreditAttribution: webservant316 commentedThis issue may be relevant https://www.drupal.org/node/2898779#comment-12208517.
I am trying to see how the soundjs code gets installed. I am guessing it is part of one of the H5P libraries.
Comment #14
webservant316 CreditAttribution: webservant316 commentedThis line has an error...
a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[./]*?\//i,a.EXTENSION_PATT=/\/?[^/]+\.(\w{1,5})$/i
and should instead escape the two bracketed / like this...
a.ABSOLUTE_PATT=/^(?:\w+:)?\/{2}/i,a.RELATIVE_PATT=/^[.\/]*?\//i,a.EXTENSION_PATT=/\/?[^\/]+\.(\w{1,5})$/i
How do we fix that? I think H5P.SoundJS-1.0 is just a utility library used by other libraries.
Comment #15
webservant316 CreditAttribution: webservant316 commentedComment #16
paalj CreditAttribution: paalj commentedwebservant316: Kudos to you for finding the cause of this problem, we really appreciate it! It is strange we are not seeing this on our sites, but that regexp certainly looks strange.
The h5p-soundjs library is using 0.6.0 of the soundjs library. I see the regexp has been fixed in version 0.6.1. The solution will be to update the h5p library to use the latest stable version of this external javascript. Hopefully, I will be able to provide you a new version today!
Comment #17
paalj CreditAttribution: paalj commentedComment #18
paalj CreditAttribution: paalj commentedI have updated the H5P.SoundJS library, but not released it yet. I would like you to test it first, since I am not able to reproduce. The new version is available here: http://fnoks.joubel.com/html/h5p-soundjs-1.0.2.h5p. Could you please:
Let me know how it goes
Comment #19
webservant316 CreditAttribution: webservant316 commentedI uploaded "Sound js api (1.0.2)" and it works. I can turn on Drupal core javascript aggregation and the H5P question types still work.
Thanks!
BTW credit for the find goes to @mikeytown2 at https://www.drupal.org/node/2898779.
Comment #20
paalj CreditAttribution: paalj commentedSuper! Thanks for letting us know. The new version of H5P.SoundJS is now released: h5p.org/post-hub-releases
Comment #21
paalj CreditAttribution: paalj commented