134 Commits

Author SHA1 Message Date
Matteo Scaramuccia
ef844148a9 MDL-60923 backup: Added $CFG->backuptempdir
The new setting will allow to host the temporary backup files
into a specific target directory. Defaults to '$CFG->tempdir/backup'.

Calling make_backup_temp_directory() checks that the required sub-directory
will be properly created under the new target directory.
2018-04-16 23:50:28 +02:00
Andrew Nicols
e6a4780452 MDL-58297 core: Update to use new hashing functions 2017-04-07 10:40:23 +08:00
Rajesh Taneja
52f3e060e4
MDL-55091 phpunit: Following has been deprecated.
1. getMock()
2. setExpectedException()
3. checkForUnintentionallyCoveredCode renamed to beStrictAboutCoversAnnotation
4. beStrictAboutTestSize renamed to enforceTimeLimit
5. UnitTestCase class is now fully removed.
2016-07-26 10:11:30 +08:00
Russell Smith
1fcf0ca8a5 MDL-35628 performance: Remove dirname() where possible.
dirname() is a slow function compared with __DIR__ and using
'/../'.  Moodle has a large number of legacy files that are included
each time a page loads and is not able to use an autoloader as it is
functional code.  This allows those required includes to perform as
best as possible in this situation.
2016-06-10 08:06:49 +10:00
Rajesh Taneja
0fe86bbdbb MDL-49799 behat: replaced asd.com with example.com
asd.com is a valid domain, we should use reserved domain names for testing
2015-04-20 11:21:20 +08:00
Mark Nielsen
292f663581 MDL-47569 backup: Do not close questions tag if never opened
This can happen when restoring quizzes that
do not have any questions.
2014-10-07 11:48:35 -07:00
Marina Glancy
b76ae3b0ce Merge branch 'MDL-44630_CC_Changes' of git://github.com/moodlerooms/moodle 2014-05-08 12:05:20 +08:00
Mark Nielsen
e686494fbc MDL-44630: Fixing PHP foreach warnings 2014-05-07 12:39:47 -07:00
sam marshall
38674ef91a MDL-44070 Conditional availability enhancements (4): backup
Implements backup and restore for the new conditional availability
data. This includes:

* Backup and restore of new field.
* Restore updates IDs in conditions, as required.
* Restore converts availability data from legacy (Moodle 2.6) backups.
* Unit tests for all this.
2014-04-07 20:11:41 +01:00
Tim Hunt
dc4a3ea1ee MDL-43670 quiz_question_instances to match coding guidelines.
Some columns needed to be renamed:
* quiz     -> quizid
* question -> questionid
* grade    -> maxmark

Then all the places that refer to those needed to be fixed.
2014-01-17 10:56:07 +00:00
Petr Škoda
bde002b81a MDL-41437 rework plugin_manager caching and version info in blocks and modules
This patch includes:

* version column removed from modules table, now using standard config, this allows decimal version for modules
* version column removed from block table, now using standard config, this allows decimal version for blocks
* module version.php can safely use $plugins instead of module
* new plugin_manager bulk caching, this should help with MUC performance when logged in as admin
* all missing plugins are now in plugin overview (previously only blocks and modules)
* simplified code and improved coding style
* reworked plugin_manager unit tests - now using real plugins instead of mocks
* unit tests now fail if any plugin does not contain proper version.php file
* allow uninstall of deleted filters
2013-09-22 21:25:26 +02:00
Petr Škoda
2f1e464a88 MDL-40438 migrate all collatorlib:: and textlib:: uses 2013-08-06 21:04:35 +02:00
Petr Škoda
8252b7c291 MDL-40901 standardise core test case class and file names
This finally allows us to type only the class name when executing individual core test cases.
2013-08-04 22:10:31 +02:00
Petr Škoda
bd3b3bba9f MDL-40220 use new core_component::get_plugin_list() 2013-07-16 22:36:11 +02:00
Jean-Michel Vedrine
3f28674535 MDL-33424 Images missing when restoring a 1.9 backup 2013-03-09 13:51:34 +01:00
David Mudrák
d0530ed444 MDL-37774 Make moodle1_file_manager::migrate_directory() support trailing slash in rootpath
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.
2013-02-08 11:45:24 +01:00
David Mudrák
86083f9752 MDL-37774 Add unit test to illustrate the problem with the trailing slash
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.
2013-02-08 11:41:38 +01:00
Petr Škoda
a629ad3dff MDL-37780 fix 1.9 restore on windows 2013-01-30 20:28:06 +01:00
David Mudrák
0ab681d3e7 MDL-36977 Be more picky when it comes to migrating files in moodle1 backups 2013-01-08 08:53:38 +08:00
David Mudrák
7b66137f7b MDL-36977 Add more unit tests for moodle1 backup conversion 2013-01-08 08:53:37 +08:00
Eloy Lafuente (stronk7)
12e13ce047 Merge branch 'MDL-32880_master_3' of git://github.com/pauln/moodle 2012-12-11 22:48:06 +01:00
David Mudrák
2c9689ed21 MDL-36204 Improve moodle1 conversion of embedded files
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.
2012-11-23 03:39:17 +01:00
Paul Nicholls
a374ba237c MDL-32880: moodle1 backup converter: add generic block handler
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.
2012-11-23 09:28:50 +13:00
Paul Nicholls
36ab8f6cb6 MDL-36204: moodle1 backup converter: add unit test to cover this issue 2012-11-15 10:50:16 +13:00
Paul Nicholls
bdc468f9a6 MDL-36204: moodle1 backup converter: urldecode filenames from links
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.
2012-11-15 09:26:55 +13:00
Ankit Agarwal
556e9404cc MDL-34471 backup: Update the php doc block 2012-08-08 17:11:02 +08:00
Aaron Barnes
1d09e12936 MDL-32016 unit tests: Remove hard coded file hash and calculate dynamically 2012-05-16 11:55:39 +12:00
Petr Skoda
4ca04fb58b MDL-32569 remove remaining references to simpletest and improve events test 2012-04-21 17:08:30 +02:00
Petr Skoda
bb7898c6ab MDL-32569 convert remaining backup tests and drop old simpletests 2012-04-21 16:24:33 +02:00
Petr Skoda
4b02743182 MDL-32149 improve testcase naming and list in config file 2012-04-03 22:30:57 +02:00
Petr Skoda
1cbf2a20ca MDL-32149 setUp() and tearDown() are supposed to be 'protected', add missing blog testcase 2012-04-03 22:30:56 +02:00
Petr Skoda
dbf5a44798 MDL-32149 add backup tests and dropping of extra tables 2012-04-03 22:30:54 +02:00
Petr Skoda
caee6e6c26 MDL-32251 E_STRICT fixes part 3 2012-03-29 15:24:30 +02:00
Eloy Lafuente (stronk7)
2ed7cc2730 Merge branch 'w10_MDL-31301_m23_textlibcleanup' of git://github.com/skodak/moodle 2012-03-06 16:06:53 +01:00
Petr Skoda
f8311defeb MDL-31301 use static textlib methods 2012-03-03 11:46:13 +01:00
Eloy Lafuente (stronk7)
ac6dc09c26 MDL-29248 backup: take rid of the setting and code handling the 'private' user filearea 2012-03-01 13:09:47 +01:00
David Mudrak
10d7dac528 MDL-31317 original_site_identifier_hash falls back to null during the backup conversion
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.
2012-01-27 08:48:37 +01:00
Mark Nielsen
42dffc6feb MDL-29956: Implement common cartridge export (r16882) 2011-11-14 21:25:08 +01:00
Tim Hunt
de529cd253 MDL-30021 qtype numerical better showunits default when coming from 1.9
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.
2011-11-03 11:27:41 +00:00
Jean-Michel Vedrine
9107daa0f5 MDL-29270 Fixed question bank backup converter (field rename) 2011-09-25 23:33:00 +02:00
Tom Lanyon
7aa06e6ded MDL-28701 Change all uses of $CFG->dataroot/temp to $CFG->tempdir 2011-09-10 10:35:39 +02:00
sam marshall
8c40662e22 MDL-27001 'Show description' feature part 1: infrastructure that allows modules to support feature
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.
2011-09-06 11:03:00 +01:00
David Mudrak
3343677e0a MDL-28006 Fixed grades subpath handling
Registering the grades subpath even if we do not process the grades yet.
This is to prevent from incorrect considering the wrapper as an empty tag.
2011-06-30 15:17:03 +02:00
David Mudrak
af66e7fea3 MDL-28006 code cleanup - there is nothing to do for grade_settings 2011-06-29 09:08:25 +02:00
David Mudrak
ddefec8d14 MDL-28006 moodle1 converter supports outcomes 2011-06-29 08:55:43 +02:00
David Mudrak
d98100e407 MDL-28006 moodle1 converter supports grade letters 2011-06-29 01:06:59 +02:00
David Mudrak
cfab209904 MDL-28006 moodle1 converter supports grade categories and non-module grade items 2011-06-29 01:06:10 +02:00
David Mudrak
544e0d5972 MDL-28006 moodle1 converter supports activity module grade items 2011-06-29 00:11:05 +02:00
David Mudrak
acc9a7b9e2 MDL-28006 moodle1 converter provides new get_stash_or_default() method 2011-06-29 00:11:05 +02:00
Eloy Lafuente (stronk7)
28e23ea737 fix permissions 2011-06-16 19:06:07 +02:00