"No valid arguments supplied, path does not start with slash!" error

"No valid arguments supplied, path does not start with slash!" error

by Steve Blackwell -
Number of replies: 3

I am not and IT Technician, but a Trainer who just wants the demos/simulations window in our eLearning to pop-up, so that the software screen captures display large enough on a variety of Monitor sizes, so people can see what is going on i.e. is free of the Articulate player shell

Using Captivate without the Articulate player shell is not an option smile     My apologies for such a long post.


"No valid arguments supplied, path does not start with slash!"

The Moodle-based LMS we are using is causing this error when I try to select an embedded SWF file, which is triggered to open a pop up and run the swf demo or simulation.

Clicking the More information link that is supplied with the error, leads to "the information page has not been written yet"...

I tried finding a solution on the Articulate forums first and found this:

https://community.articulate.com/discussions/articulate-storyline/swf-interactive-animation-wont-open-in-a-new-window

A user there states:

The issue relates to the way the flash file triggers the load of the video.

The flash file has a link like this:

swf.html?file=video_.swf

The problem with this is that Moodle treats the "file" parameter in links in a special way and tries to use that to locate the file - but Moodle should be "ignoring" that parameter completely in this case.

If there's a way to rename that parameter in Articulate to something else that would help and probably be the easiest solution. Another option would be to modify Moodle code - in lib/weblib.php the function "get_file_argument()" - replacing the line:
$relativepath = optional_param('file', false, PARAM_PATH);
with:
$relativepath = false;

Technical/Historical detail.
Moodle provides support for web servers that do not support slash arguments and uses the "file" param within the url to obtain user-uploaded files. But - all modern web servers now support slash arguments (although some default web-server configuration need changing to support it.) SCORM in Moodle requires relative linking (slash arguments) to be working and functional.

Because some sites would have been created prior to setting up slash arguments the server needs to support the "old" method using the file param and the slash arguments method as there may be hard-coded urls using the "old" url linking method. For new sites that have always supported slash-arguments it is unlikely there are any remaining links using the older "file" param so it should be safe to disable the file param handling in the core get_file_handling() function. (but it would be best to test this)

However, the Articulate staff member said they can't support changes to the files:

Changing the published output files isn't something we can support.  Lots of folks brainstorm in these forums, though, and are able to create what they need.  So we defer to you all with those workarounds!

Yesterday, the 3rd Party consultancy firm (Let's call them A) that manages the Moodle-flavoured LMS created by another 3rd Party (Let's call them B), finally responded and suggested a change to the swf.html and presentation.js files created by the published Articulate package:

The steps are provided below but unfortunately this isn't something that we would support directly:

1. Edit the file 'presentation_content/swf.html' and change the string "file" to "filename" on lines 21, 67, and 84. (if the line numbers change on subsequent published files, use the original package as a guide.)
2. Edit the file "presentation_content/presentation.js" and change the string "file" to "filename" on line 954. (again, use the original package as a guide if subsequent published files change the line numbers.)

However, Company A couldn't guarantee that Company B wouldn't change their code for the LMS site, in the future, and effectively break the courses changed this way.

Now a day after checking and seeing the pop-up work, they have come back to the person in our company working on the LMS to the effect that:

Company A are now not willing to raise this directly with Company B as their developers have referred to the fix as ‘a hack’.


So where does that now leave us?  If anyone can respond on this it would be helpful.  Thanks for your help in advance.

Attachment Slash Error.PNG
Average of ratings: -
In reply to Steve Blackwell

Re: "No valid arguments supplied, path does not start with slash!" error

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Steve,
thanks for this detailed post.

A tracker issue has been already filed and I'll link your post there too for reference: MDL-57379.

HTH,
Matteo

Average of ratings: Useful (1)
In reply to Matteo Scaramuccia

Re: "No valid arguments supplied, path does not start with slash!" error

by Steve Blackwell -

Thanks Matteo.

I checked out the tracker.  It's funny as I had originally raised this internally in November, saw Dan's articulate post and have just been waiting for a response from the 3rd parties.  I'm surprised no-one raised it before too.

We only recently went onto Moodle for LMS and at the end of the year finally got the software to write our own courses.

Would you recommend using the suggested "hack" in the short term and when the development is complete (is this scheduled any time soon?) I assume that the third party would have to upgrade to that new version.  How would I/we inform them of the fix?


Thanks again, you have been very helpful.

In reply to Steve Blackwell

Re: "No valid arguments supplied, path does not start with slash!" error

by Matteo Scaramuccia -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hi Steve,
the best workaround is to hack the Moodle code as below:

diff --git a/lib/weblib.php b/lib/weblib.php
index 0d9ce7f..aa319ac 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -1104,9 +1104,12 @@ function validate_email($address) {
  * @return string file path (only safe characters)
  */
 function get_file_argument() {
-    global $SCRIPT;
+    global $CFG, $SCRIPT;

-    $relativepath = optional_param('file', false, PARAM_PATH);
+    $relativepath = false;
+    if (empty($CFG->slasharguments)) {
+        $relativepath = optional_param('file', false, PARAM_PATH);
+    }

     if ($relativepath !== false and $relativepath !== '') {
         return $relativepath;

which is quite similar to your hack above by less drastic since it honors the slasharguments setting.

The proposal that will land into Moodle, hopefully within two weeks, will be more selective - applied only to SCORM related URLs - and conservative since some people could use the current Moodle behavior for creating some links based on the HTTP GET key file.

Please, note that the SCORM activity is maintained on a voluntary basis wink.

HTH,
Matteo