As the $rootpath is concatenated with the $relpath, we would end with a
path like course_files//file.txt. Such a path is detected as not-valid
later and an error would be thrown.
So the patch makes sure that the trailing slash is cut off and a
debugging for the developer is displayed.
The patch introduces two new tests for moodle1_file_manager::migrate_directory().
The second test with the trailing slash reveals the trouble here.
The expected behaviour is that the method would deal with the trailing
slash. Debugging message for the developer should be displayed though.
URL of files referenced in HTML fields via $@FILEPHP$@ are usually
encoded if they were linked using the HTML editor. So if they contain
spaces or plus signs in the name, their URL is encoded to use %20 and
%2B respectively.
Sometimes, for example when the HTML was edited manually in 1.9 without
the editor, non-encoded file names may be put into the HTML text. Such a
link used to work in 1.9 so we add an explicit support for it, too.
However, we do not support partially encoded URLs (e.g. only spaces are
encoded while plus signs are not). Such links are unmodified and will
rely on Legacy files support.
This handler will automatically be used for any block which does not provide its own handler, and should be subclassed by any block which needs to do anything extra (or different).
This commit incorporates contributions from Mike Churchward and API design suggestions from David Mudrak.
If filenames are not run through urldecode(), those that contain spaces (or other url-encoded characters) will not be handled, as they can't be found in the backup file.
Even if the site identifier is not defined in the source 1.9 backup then the
converted 2.0 version should still contain the element to prevent PHP
notices on direct assignment.
This applies to:
1. Upgrade from 1.9,
2. Import of questions exported from 1.9, and
3. Restore of courses backed-up from 1.9.
It also applies to the calculated question type.
The 'Show description' feature is about optionally including module description on the course page. This change include the necessary infrastructure - new database field, new FEATURE constant, changes to forms to display it, new language strings for it, backup and restore, and old course conversion. (I found the places to change by searching for an existing field in course_modules).
Documentation for the field is included in install.xml and in modinfolib.
During the restore, the section's sequence field is ignored and the
order of modules is controlled by the order of the <contents> activity
elements. This patch makes sure that the modules are listed in that
section in the right order.
Also, the patch removes the obsolete stash sectionidslist which was
introduced when the method get_stash_itemids() had not existed yet.
This helper class keeps the referenced ids to be dumped into the
inforef.xml files. For now, it uses a in-memory storage structures but
in the future we may refactor it so that it can use some persistent
storage (like converter's stashes).
We want to set migrated content file in the File module as a main file.
Main files are files with sortorder set to 1. Therefore the file manager
must provide a way to set the sortorder property of the new file record.
The second change allowing filepaths not ending with slash is a helper
as we can easily use dirname() as a value (see the usage in the next
commits). Not providing the dirname() was a bug as the reference to a
file in the HTML text did not respect the migrated file path.