Permalink
Browse files

Merge branch 'MOODLE_25_STABLE' into install_25_STABLE

  • Loading branch information...
2 parents c0aa2a2 + f171a8c commit 0147686fc7e2ca9abf4279232334cafd98fa7f35 AMOS bot committed Jul 27, 2013
Showing with 825 additions and 380 deletions.
  1. +2 −0 admin/environment.xml
  2. +7 −3 admin/tests/behat/behat_admin.php
  3. +1 −1 admin/tests/behat/display_short_names.feature
  4. +3 −0 admin/tool/behat/cli/util.php
  5. +1 −2 admin/tool/behat/lang/en/tool_behat.php
  6. +2 −2 admin/tool/behat/tests/behat/basic_actions.feature
  7. +8 −8 admin/tool/behat/tests/behat/data_generators.feature
  8. +4 −6 admin/tool/profiling/index.php
  9. +1 −1 admin/tool/profiling/lang/en/tool_profiling.php
  10. +5 −5 auth/tests/behat/behat_auth.php
  11. +19 −4 backup/backupfilesedit_form.php
  12. +13 −6 backup/util/dbops/restore_dbops.class.php
  13. +2 −2 backup/util/ui/tests/behat/backup_courses.feature
  14. +46 −33 backup/util/ui/tests/behat/behat_backup.php
  15. +42 −5 backup/util/xml/parser/processors/grouped_parser_processor.class.php
  16. +14 −1 badges/backpack.js
  17. +2 −4 badges/badge.php
  18. +2 −5 badges/mybadges.php
  19. +7 −4 badges/renderer.php
  20. +7 −4 blocks/comments/tests/behat/behat_block_comments.php
  21. +3 −3 blocks/course_overview/renderer.php
  22. +2 −2 blocks/tests/behat/behat_blocks.php
  23. +1 −1 blocks/tests/behat/configure_block_throughout_site.feature
  24. +2 −1 cache/stores/memcache/addinstanceform.php
  25. +1 −0 cache/stores/memcache/lang/en/cachestore_memcache.php
  26. +1 −1 cache/stores/memcache/lib.php
  27. +32 −1 cache/stores/memcache/tests/memcache_test.php
  28. +4 −3 cache/stores/memcached/addinstanceform.php
  29. +1 −0 cache/stores/memcached/lang/en/cachestore_memcached.php
  30. +2 −2 cache/stores/memcached/lib.php
  31. +32 −1 cache/stores/memcached/tests/memcached_test.php
  32. +2 −2 cache/tests/fixtures/stores.php
  33. +9 −9 cohort/tests/behat/behat_cohort.php
  34. +2 −2 cohort/tests/behat/upload_cohort_users.feature
  35. +12 −9 completion/tests/behat/behat_completion.php
  36. +2 −3 course/renderer.php
  37. +6 −6 course/tests/behat/activities_group_icons.feature
  38. +2 −2 course/tests/behat/activities_indentation.feature
  39. +46 −42 course/tests/behat/behat_course.php
  40. +15 −15 course/tests/behat/force_group_mode.feature
  41. +4 −4 enrol/tests/behat/behat_enrol.php
  42. +7 −4 grade/grading/form/guide/lib.php
  43. +2 −2 grade/grading/form/guide/version.php
  44. +31 −5 grade/grading/form/lib.php
  45. +6 −3 grade/grading/form/rubric/lib.php
  46. +2 −2 grade/grading/form/rubric/styles.css
  47. +2 −2 grade/grading/form/rubric/version.php
  48. +9 −0 grade/grading/form/upgrade.txt
  49. +4 −0 grade/report/grader/lib.php
  50. +9 −6 group/tests/behat/behat_groups.php
  51. +1 −0 lang/en/badges.php
  52. +16 −0 lib/badgeslib.php
  53. +25 −17 lib/behat/behat_files.php
  54. +4 −1 lib/behat/form_field/behat_form_select.php
  55. +26 −0 lib/behat/lib.php
  56. +4 −11 lib/editor/tinymce/plugins/spellchecker/config.php
  57. +6 −0 lib/editor/tinymce/plugins/spellchecker/lib.php
  58. +2 −2 lib/editor/tinymce/plugins/spellchecker/settings.php
  59. +2 −1 lib/navigationlib.php
  60. +4 −0 lib/setup.php
  61. +1 −0 lib/tablelib.php
  62. +21 −21 lib/tests/behat/behat_forms.php
  63. +4 −4 lib/tests/behat/behat_general.php
  64. +23 −4 lib/tests/behat/behat_hooks.php
  65. +17 −11 lib/tests/behat/behat_navigation.php
  66. +11 −11 lib/tests/behat/behat_permissions.php
  67. +30 −8 lib/xhprof/xhprof_moodle.php
  68. +5 −5 message/tests/behat/behat_message.php
  69. +4 −3 mod/assign/locallib.php
  70. +4 −0 mod/chat/gui_ajax/theme/bubble/chat.css
  71. +1 −1 mod/choice/tests/behat/behat_mod_choice.php
  72. +1 −1 mod/folder/lang/en/folder.php
  73. +6 −1 mod/folder/renderer.php
  74. +4 −4 mod/forum/tests/behat/behat_mod_forum.php
  75. +2 −2 mod/forum/tests/behat/completion_condition_number_discussions.feature
  76. +3 −3 mod/glossary/tests/behat/behat_mod_glossary.php
  77. +2 −2 mod/glossary/tests/behat/print_friendly_version.feature
  78. +1 −1 mod/lesson/tests/behat/lesson_navigation.feature
  79. +1 −1 mod/quiz/report/statistics/statistics_question_table.php
  80. +8 −0 mod/quiz/styles.css
  81. +9 −3 mod/wiki/pagelib.php
  82. +12 −6 question/tests/behat/behat_question.php
  83. +1 −0 report/questioninstances/index.php
  84. +1 −1 repository/recent/tests/behat/behat_repository_recent.php
  85. +6 −4 repository/tests/behat/behat_filepicker.php
  86. +1 −1 repository/tests/behat/cancel_add_file.feature
  87. +3 −3 repository/upload/tests/behat/behat_repository_upload.php
  88. +4 −1 theme/bootstrapbase/less/moodle/admin.less
  89. +2 −2 theme/bootstrapbase/less/moodle/core.less
  90. +26 −0 theme/bootstrapbase/less/moodle/expendable.less
  91. +1 −0 theme/bootstrapbase/less/moodle/filemanager.less
  92. +9 −0 theme/bootstrapbase/less/moodle/forms.less
  93. +15 −1 theme/bootstrapbase/less/moodle/grade.less
  94. +6 −1 theme/bootstrapbase/less/moodle/question.less
  95. +32 −0 theme/bootstrapbase/less/moodle/responsive.less
  96. +2 −2 theme/bootstrapbase/style/moodle.css
  97. +13 −9 theme/index.php
  98. +2 −2 version.php
View
@@ -957,6 +957,8 @@
<ON_ERROR message="ziprequired" />
</FEEDBACK>
</PHP_EXTENSION>
+ <PHP_EXTENSION name="zlib" level="optional">
+ </PHP_EXTENSION>
<PHP_EXTENSION name="gd" level="required">
<FEEDBACK>
<ON_ERROR message="gdrequired" />
@@ -62,7 +62,7 @@ public function i_set_the_following_administration_settings_values(TableNode $ta
}
// Search by label.
- $searchbox = $this->find_field('Search in settings');
+ $searchbox = $this->find_field(get_string('searchinsettings', 'admin'));
$searchbox->setValue($label);
$submitsearch = $this->find('css', 'form.adminsearchform input[type=submit]');
$submitsearch->press();
@@ -72,8 +72,12 @@ public function i_set_the_following_administration_settings_values(TableNode $ta
// Admin settings does not use the same DOM structure than other moodle forms
// but we also need to use lib/behat/form_field/* to deal with the different moodle form elements.
$exception = new ElementNotFoundException($this->getSession(), '"' . $label . '" administration setting ');
+
+ // The argument should be converted to an xpath literal.
+ $label = $this->getSession()->getSelectorsHandler()->xpathLiteral($label);
+
$fieldxpath = "//*[self::input | self::textarea | self::select][not(./@type = 'submit' or ./@type = 'image' or ./@type = 'hidden')]" .
- "[@id=//label[contains(normalize-space(string(.)), '" . $label . "')]/@for]";
+ "[@id=//label[contains(normalize-space(.), $label)]/@for]";
$fieldnode = $this->find('xpath', $fieldxpath, $exception);
$formfieldtypenode = $this->find('xpath', $fieldxpath . "/ancestor::div[@class='form-setting']" .
"/child::div[contains(concat(' ', @class, ' '), ' form-')]/child::*/parent::div");
@@ -90,7 +94,7 @@ public function i_set_the_following_administration_settings_values(TableNode $ta
$field = behat_field_manager::get_field_instance($type, $fieldnode, $this->getSession());
$field->set_value($value);
- $this->find_button('Save changes')->press();
+ $this->find_button(get_string('savechanges'))->press();
}
}
@@ -15,7 +15,7 @@ Feature: Display extended course names
And I should not see "C_shortname Course fullname"
Scenario: Courses list with extended course names
- Given I click on "Courses" "link" in the "//div[@id='settingsnav']//descendant::li[contains(concat(' ', @class, ' '), ' type_setting ')][not(contains(., 'Site administration'))][contains(., 'Appearance')]" "xpath_element"
+ Given I click on "Courses" "link" in the "//div[@id='settingsnav']/descendant::li[contains(concat(' ', normalize-space(@class), ' '), ' type_setting ')][not(contains(., 'Site administration'))][contains(., 'Appearance')]" "xpath_element"
And I check "Display extended course names"
When I press "Save changes"
And I am on homepage
@@ -142,6 +142,9 @@
$CFG->{$var} = $CFG->{'behat_' . $var};
}
+// Clean $CFG extra values before performing any action.
+behat_clean_init_config();
+
$CFG->noemailever = true;
$CFG->passwordsaltmain = 'moodle';
@@ -41,6 +41,5 @@
$string['viewsteps'] = 'Filter';
$string['wheninfo'] = 'When. Actions that provokes an event';
$string['wrongbehatsetup'] = 'Something is wrong with behat setup, ensure:<ul>
-<li>You ran "curl http://getcomposer.org/installer | php"</li>
-<li>You ran "php composer.phar install --dev"</li>
+<li>You ran "php admin/tool/behat/cli/init.php" from your moodle root directory</li>
<li>vendor/bin/behat file has execution permissions</li></ul>';
@@ -37,13 +37,13 @@ Feature: Page contents assertions
And I follow "Course 1"
When I click on "Move this to the dock" "button" in the ".block_settings" "css_element"
Then I should not see "Question bank"
- And I click on "//div[@id='dock']/descendant::*[contains(., 'Administration')]/h2" "xpath_element"
+ And I click on "//div[@id='dock']/descendant::h2[normalize-space(.)='Administration']" "xpath_element"
@javascript
Scenario: Locators inside specific DOM nodes using XPath
Given the following "courses" exists:
| fullname | shortname | category |
| Course 1 | C1 | 0 |
And I log in as "admin"
- When I click on "Move this to the dock" "button" in the "//*[contains(concat(' ', normalize-space(@class), ' '), ' block_settings ')]" "xpath_element"
+ When I click on "Move this to the dock" "button" in the "//div[contains(concat(' ', normalize-space(@class), ' '), ' block_settings ')]" "xpath_element"
Then I should not see "Turn editing on"
@@ -30,17 +30,17 @@ Feature: Set up contextual data for tests
Then I should see "Course 1"
And I should see "Course 2"
And I should see "Course 3"
- When I go to the courses management page
+ And I go to the courses management page
And I follow "Cat 1"
- Then I should see "Cat 2"
+ And I should see "Cat 2"
And I should see "Cat 3"
- When I follow "Cat 3"
- Then I should see "Course 1"
+ And I follow "Cat 3"
+ And I should see "Course 1"
And I should see "Course 2"
- When I select "Cat 2" from "Course categories:"
- Then I should see "No courses in this category"
- When I select "Miscellaneous" from "Course categories:"
- Then I should see "Course 3"
+ And I select "Cat 1 / Cat 2" from "Course categories:"
+ And I should see "No courses in this category"
+ And I select "Miscellaneous" from "Course categories:"
+ And I should see "Course 3"
@javascript
Scenario: Add a bunch of groups and groupings
@@ -74,12 +74,11 @@
$prevreferences = $DB->get_records_select('profiling',
'url = ? AND runreference = 1 AND timecreated < ?',
array($run->url, $run->timecreated),
- 'timecreated DESC', 'runid', 0, 1);
- $prevrunid = $prevreferences ? reset($prevreferences)->runid : false;
+ 'timecreated DESC', 'runid, runcomment, timecreated', 0, 10);
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
$header = get_string('lastrunof', 'tool_profiling', $script);
echo $OUTPUT->heading($header);
- $table = profiling_print_run($run, $prevrunid);
+ $table = profiling_print_run($run, $prevreferences);
echo $table;
echo $OUTPUT->box_end();
@@ -126,12 +125,11 @@
$prevreferences = $DB->get_records_select('profiling',
'url = ? AND runreference = 1 AND timecreated < ?',
array($run->url, $run->timecreated),
- 'timecreated DESC', 'runid', 0, 1);
- $prevrunid = $prevreferences ? reset($prevreferences)->runid : false;
+ 'timecreated DESC', 'runid, runcomment, timecreated', 0, 10);
echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter');
$header = get_string('summaryof', 'tool_profiling', $run->url);
echo $OUTPUT->heading($header);
- $table = profiling_print_run($run, $prevrunid);
+ $table = profiling_print_run($run, $prevreferences);
echo $table;
echo $OUTPUT->box_end();
@@ -51,5 +51,5 @@
$string['runid'] = 'Run ID';
$string['summaryof'] = 'Summary of {$a}';
$string['viewdetails'] = 'View profiling details';
-$string['viewdiff'] = 'View profiling differences with last reference run';
+$string['viewdiff'] = 'View profiling differences with:';
$string['viewdiffdetails'] = 'View profiling diff details';
@@ -49,10 +49,10 @@ class behat_auth extends behat_base {
public function i_log_in_as($username) {
return array(new Given('I am on homepage'),
- new Given('I follow "Login"'),
- new Given('I fill in "Username" with "'.$username.'"'),
- new Given('I fill in "Password" with "'.$username.'"'),
- new Given('I press "Login"')
+ new Given('I follow "' . get_string('login') . '"'),
+ new Given('I fill in "' . get_string('username') . '" with "' . $this->escape($username) . '"'),
+ new Given('I fill in "' . get_string('password') . '" with "'. $this->escape($username) . '"'),
+ new Given('I press "' . get_string('login') . '"')
);
}
@@ -62,7 +62,7 @@ public function i_log_in_as($username) {
* @Given /^I log out$/
*/
public function i_log_out() {
- return new When('I follow "Logout"');
+ return new When('I follow "' . get_string('logout') . '"');
}
}
@@ -1,5 +1,4 @@
<?php
-
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
@@ -24,16 +23,32 @@
require_once($CFG->libdir.'/formslib.php');
class backup_files_edit_form extends moodleform {
- function definition() {
+
+ /**
+ * Form definition.
+ */
+ public function definition() {
$mform =& $this->_form;
- $contextid = $this->_customdata['contextid'];
- $options = array('subdirs'=>0, 'maxfiles'=>-1, 'accepted_types'=>'*', 'return_types'=>FILE_INTERNAL | FILE_REFERENCE);
+
+ $options = array('subdirs' => 0, 'maxfiles' => -1, 'accepted_types' => '*', 'return_types' => FILE_INTERNAL | FILE_REFERENCE);
+
$mform->addElement('filemanager', 'files_filemanager', get_string('files'), null, $options);
+
$mform->addElement('hidden', 'contextid', $this->_customdata['contextid']);
+ $mform->setType('contextid', PARAM_INT);
+
$mform->addElement('hidden', 'currentcontext', $this->_customdata['currentcontext']);
+ $mform->setType('currentcontext', PARAM_INT);
+
$mform->addElement('hidden', 'filearea', $this->_customdata['filearea']);
+ $mform->setType('filearea', PARAM_AREA);
+
$mform->addElement('hidden', 'component', $this->_customdata['component']);
+ $mform->setType('component', PARAM_COMPONENT);
+
$mform->addElement('hidden', 'returnurl', $this->_customdata['returnurl']);
+ $mform->setType('returnurl', PARAM_URL);
+
$this->add_action_buttons(true, get_string('savechanges'));
$this->set_data($this->_customdata['data']);
}
@@ -614,13 +614,20 @@ public static function prechek_precheck_qbanks_by_level($restoreid, $courseid, $
} else {
self::set_backup_ids_record($restoreid, 'question_category', $category->id, $matchcat->id, $targetcontext->id);
$questions = self::restore_get_questions($restoreid, $category->id);
+
+ // Collect all the questions for this category into memory so we only talk to the DB once.
+ $questioncache = $DB->get_records_sql_menu("SELECT ".$DB->sql_concat('stamp', "' '", 'version').", id
+ FROM {question}
+ WHERE category = ?", array($matchcat->id));
+
foreach ($questions as $question) {
- $matchq = $DB->get_record('question', array(
- 'category' => $matchcat->id,
- 'stamp' => $question->stamp,
- 'version' => $question->version));
+ if (isset($questioncache[$question->stamp." ".$question->version])) {
+ $matchqid = $questioncache[$question->stamp." ".$question->version];
+ } else {
+ $matchqid = false;
+ }
// 5a) No match, check if user can add q
- if (!$matchq) {
+ if (!$matchqid) {
// 6a) User can, mark the q to be created
if ($canadd) {
// Nothing to mark, newitemid means create
@@ -645,7 +652,7 @@ public static function prechek_precheck_qbanks_by_level($restoreid, $courseid, $
// 5b) Match, mark q to be mapped
} else {
- self::set_backup_ids_record($restoreid, 'question', $question->id, $matchq->id);
+ self::set_backup_ids_record($restoreid, 'question', $question->id, $matchqid);
}
}
}
@@ -31,7 +31,7 @@ Feature: Backup Moodle courses
And I should not see "Section 3"
And I press "Continue"
And I click on "Continue" "button" in the ".bcs-current-course" "css_element"
- And I click on "//div[contains(concat(' ', @class, ' '), ' fitem ')][contains(., 'Include calendar events')]/descendant::img" "xpath_element"
- And I click on "setting_root_logs" "checkbox" in the "//div[contains(@class, 'fitem')][contains(., 'Include course logs')]" "xpath_element"
+ And "//div[contains(concat(' ', normalize-space(@class), ' '), ' fitem ')][contains(., 'Include calendar events')]/descendant::img" "xpath_element" should exists
+ And I check "Include course logs"
And I press "Cancel"
And I click on "Cancel" "button" in the ".confirmation-dialogue" "css_element"
Oops, something went wrong.

0 comments on commit 0147686

Please sign in to comment.