There were two major issues with the previous implementation:
* The exported folder name was localised so it was "Files" or "Soubory"
etc depending on the current language. Yet URLs referring to the files
in that folder were always rewritten with hard-coded English "files".
* Files from all fileareas and itemids were all exported to a single
target directory. So if there were two files with the same name being
exported from multiple areas (such as submission_content and
submission_attachment in the workshop module), one would overwrite
another.
The patch addresses these issues as follows:
* To unify the folder name and also to minimise the risk of conflict
with a subcontext folder, we now always export stored files under
"_files" folder.
* Under that folder, there is a subdirectory with the area name and then
eventually another subdirectory with non-zero itemid. And there
finally the stored_file is exported to under its own file path.
Some subsystems are like conduits, passing data along to plugins which,
in turn, send the data externally. Only the component linking to (using)
the subsystem will know what data it is sending along to the eventual
external system, so should be able to specify this at the time of
linking. The same goes for plugintypes.
- Define sitepolicy handler manager class, base class and the core handler
- Allow to set a plugin as sitepolicyhandler that implements the sitepolicy API
- Modify web services to return information from the 3rd party handler instead of core if needed
This legacy polyfill allows plugin developers who release a single
branch to work with multiple versions of Moodle to support the API in
both Moodle 3.3 with PHP 5.6, and later versions.