file picker not showing files when editing settings

file picker not showing files when editing settings

by Andrew Downes -
Number of replies: 2

For the Moodle 3.0 release of the Tin Can launch plugin, I've added the #1 requested feature - the facility to upload Tin Can zip packages rather than having to point to externally hosted content. 

This all works nicely except that when you upload a file, save the settings and then go back to edit the module the zip file is not listed in the file picker. I've checked that it's getting a default value that seems realistic (I don't know how to check if it's correct) and I know it's possible to access the files because I'm successfully getting metadata from the tincan.xml file and launching the unzipped activity. 

I used the SCORM module a lot as reference for this feature, and also looked at the Resource module. 

The Github issue is here: https://github.com/garemoko/moodle-mod_tincanlaunch/issues/79 I'd prefer replies on GitHub, but any help anywhere is good! 

I'll be bundling all this into a release in the next hour or so whether I fix that bug or not, so right now the best place to get the plugin is https://github.com/garemoko/moodle-mod_tincanlaunch/archive/master.zip but later it will be the Plugins directory

Thanks!

Andrew

P.S. the plugin probably works on earlier Moodle versions if you want to try it there. You'll need to tweak version.php to avoid complaints from Moodle. 

Average of ratings: -
In reply to Andrew Downes

Re: file picker not showing files when editing settings

by Andrew Downes -

BUMP. 

Can anybody offer any advice for this? If I can get some direction, i can probably make some time over the Christmas break to implement a fix in the plugin. 

Andew

In reply to Andrew Downes

Re: file picker not showing files when editing settings

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I've had a quick glance at your code and can't see anything obviously wrong with what you are doing.

Does the expected 'package' record exist in mdl_files after saving the draft area contents?

If you put a breakpoint in the data_preprocessing function in your form what happens? 

What database query does it use to find the existing files (in the file_prepare_draft_area function)? 

If the correct record exists in mdl_files then there must be a reason (inside that function) why it is not finding it.