Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-23656

Convert the database module's preset system to make use of the new file API



    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0
    • Fix Version/s: 2.0
    • Labels:
    • Affected Branches:
    • Fixed Branches:


      Pasted from Dev chat so I don't forget it:

      samhemelryk: I am presently looking at fixing up a couple of things with the database modules preset functionality
      samhemelryk: I have avoided it so far but am curious to know what you think the best approach to how to handle saved presets is
      samhemelryk: Presently there are the standard ones (one only) in mod/data/presets
      skodak: it should be in separate file area I think
      samhemelryk: But then you can save new ones as well which are available throughout the site, and get stored in moodledata/data/presets/userid/presetname
      samhemelryk: Would you use the module context for it?
      samhemelryk: The module context the preset was saved from I mean
      skodak: in theory you can use any context, but then you would not back it up
      skodak: you could save the presets at course level or higher
      samhemelryk: Right, and add a new filearea to pluginfile.php then
      skodak: no changes in pluginfile.php
      skodak: it is already designed for this
      skodak: that is why I added the component there
      samhemelryk: Ahh I see (looking at pluginfile now)
      samhemelryk: Right OK so I could store at sys context, and wouldn't have to worry about backup/restore at all
      skodak: yes, any activity outside of module context is ignored by backup/restore
      skodak: activity data
      samhemelryk: filebrowser::get_file_info_context_system for browsing then?
      samhemelryk: No scrap that
      skodak: you would just use file_storage
      samhemelryk: file_storage::get_area_files with the correct args
      skodak: yes
      samhemelryk: Cool
      samhemelryk: We'll I'll do that now, I may get you to review the patch before I commit if thats OK
      samhemelryk: One more question actually, I will need to move existing presets from moodledata/data/presets on upgrade, is the file API stuff OK to use during upgrade? or should I not worry about this?
      skodak: yes, you can use core file stuff in module upgrade
      skodak: if it ever changes we would have to fix all module upgrade files
      skodak: it is a lot more tricky in core


          Issue Links



              • Assignee:
                samhemelryk Sam Hemelryk
                samhemelryk Sam Hemelryk
                Component watchers:
                Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias
              • Votes:
                0 Vote for this issue
                0 Start watching this issue


                • Created:
                  Fix Release Date: