Problem/Motivation

Files linked to in the REST API are served from a (generally shared, not just REST) endpoint, that requires authentication using the same tokens but different parameter names as the REST endpoint. (NB it also requires the core_files_get_files permission).

Specific use case, add the ability to download files attached to courses in the course migration.

Proposed resolution & Tasks

Implement a method for accessing the files on the Moodle Service.
Add a process plugin for migrations.

User interface changes

None.

API changes

New method: MoodleRest::requestFile() and new migrate plugin moodle_file

Data model changes

None. Just document how to add field to courses, and give an example of the migration.

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

    Comments

    ekes created an issue. See original summary.

    • ekes committed 9be9057 on feature/3249334-files
      Method for file endpoint; migration process plugin: #3249334
      
      Process...

    • ekes committed 1e4a336 on moodle_rest-3249334
      Method for file endpoint; migration process plugin: #3249334
      
      Process...

    • ekes committed 27de438 on moodle_rest-3249334
      Add documentation for #3249334 retreiving files.
      

    • ekes committed b858a89 on 1.0.x
      Issue #3249334 by ekes: Moodle files method for file endpoint and...
    ekes’s picture

    Merged.

    ekes’s picture

    Status: Active » Fixed

    Status: Fixed » Closed (fixed)

    Automatically closed - issue fixed for 2 weeks with no activity.