From 69d0851739fbc43b35df77950bcc59103d403816 Mon Sep 17 00:00:00 2001 From: Nithy1anand Date: Sat, 17 Jun 2023 14:23:59 +0530 Subject: [PATCH 1/7] Fixed the import() function parameters issue. --- classes/course_importer.php | 5 ++--- version.php | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/classes/course_importer.php b/classes/course_importer.php index 3351a9d..2d50eff 100644 --- a/classes/course_importer.php +++ b/classes/course_importer.php @@ -72,7 +72,7 @@ public static function import_from_template($templateid, $courseid) { $backuptempdir = make_backup_temp_directory('template' . $templateid); $files[0]->extract_to_pathname($fp, $backuptempdir); - self::import('template' . $templateid, $courseid, $templateid); + self::import('template' . $templateid, $courseid); } else { $course = (array) $DB->get_record('course', array('id' => $courseid)); $course['format'] = $template->format; @@ -106,13 +106,12 @@ public static function import_from_template($templateid, $courseid) { * * @param string $backuptempdir * @param int $courseid - * @param int $templateid * @throws \base_plan_exception * @throws \base_setting_exception * @throws \dml_exception * @throws \restore_controller_exception */ - public static function import($backuptempdir, $courseid, $templateid) { + public static function import($backuptempdir, $courseid) { global $USER, $DB; $course = $DB->get_record('course', ['id' => $courseid]); diff --git a/version.php b/version.php index 5b2845b..2c8de02 100644 --- a/version.php +++ b/version.php @@ -24,7 +24,7 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2023050801; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2023061700; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2022041900; // Requires this Moodle version. $plugin->release = 'Version 1.3'; $plugin->component = 'format_kickstart'; // Full name of the plugin (used for diagnostics). From 08662aa3c81dcef32099f104de316fcdd40d9b08 Mon Sep 17 00:00:00 2001 From: Nithy1anand Date: Wed, 12 Jul 2023 16:39:11 +0530 Subject: [PATCH 2/7] Implemented the Moodle-4.2 compatibility. --- classes/form/template_form.php | 6 ++- classes/output/course_template_list.php | 25 +++++---- classes/output/renderer.php | 4 +- classes/template_table.php | 16 +++++- db/install.xml | 2 +- db/upgrade.php | 16 ++++-- freetemplates.php | 2 +- lang/en/format_kickstart.php | 2 +- lib.php | 27 ++++++++++ styles.css | 28 ++++++++-- template.php | 53 ++++++++++++------- templates.php | 2 - templates/course_template_list.mustache | 2 +- templates/import_course_list.mustache | 4 +- .../behat/format_kickstart_visibility.feature | 5 ++ tests/format_kickstart_test.php | 4 +- version.php | 4 +- 17 files changed, 151 insertions(+), 51 deletions(-) diff --git a/classes/form/template_form.php b/classes/form/template_form.php index e07b4c4..2e03e7f 100644 --- a/classes/form/template_form.php +++ b/classes/form/template_form.php @@ -50,6 +50,7 @@ public function definition() { $mform = $this->_form; $templatebgoptions = $this->_customdata['templatebgoptions']; $template = isset($this->_customdata['template']) ? $this->_customdata['template'] : []; + $editoroptions = $this->_customdata['editoroptions']; $mform->addElement('hidden', 'id'); $mform->setType('id', PARAM_INT); @@ -63,8 +64,8 @@ public function definition() { if (!$checkformat) { $mform->addRule('title', get_string('required'), 'required'); } - $mform->addElement('editor', 'description', get_string('description', 'format_kickstart')); - $mform->setType('description', PARAM_RAW); + $mform->addElement('editor', 'description_editor', get_string('description', 'format_kickstart'), null, $editoroptions); + $mform->setType('description_editor', PARAM_RAW); $mform->addElement('tags', 'tags', get_string('tags'), ['itemtype' => 'format_kickstart_template', 'component' => 'format_kickstart']); @@ -79,6 +80,7 @@ public function definition() { 'return_types' => FILE_INTERNAL | FILE_EXTERNAL ]); $mform->addHelpButton('course_backup', 'course_backup', 'format_kickstart'); + $mform->addRule('course_backup', get_string('required'), 'required'); } $mform->addElement('text', 'preview_url', get_string('previewurl', 'format_kickstart')); diff --git a/classes/output/course_template_list.php b/classes/output/course_template_list.php index e7c3b5d..edfa27e 100644 --- a/classes/output/course_template_list.php +++ b/classes/output/course_template_list.php @@ -110,14 +110,16 @@ public function get_templates() { // Apply template access if pro is installed. if (format_kickstart_has_pro()) { $categoryids = []; - $rootcategoryids = json_decode($template->categoryids, true); - if (is_array($rootcategoryids)) { - foreach ($rootcategoryids as $categoryid) { - $coursecat = \core_course_category::get($categoryid, IGNORE_MISSING); - if ($coursecat) { - $categoryids[] = $categoryid; - if ($template->includesubcategories) { - $categoryids = array_merge($categoryids, $coursecat->get_all_children_ids()); + if ($template->categoryids) { + $rootcategoryids = json_decode($template->categoryids, true); + if (is_array($rootcategoryids)) { + foreach ($rootcategoryids as $categoryid) { + $coursecat = \core_course_category::get($categoryid, IGNORE_MISSING); + if ($coursecat) { + $categoryids[] = $categoryid; + if ($template->includesubcategories) { + $categoryids = array_merge($categoryids, $coursecat->get_all_children_ids()); + } } } } @@ -132,7 +134,12 @@ public function get_templates() { } } - $template->description_formatted = format_text($template->description, $template->description_format); + $template->description_formatted = format_text(file_rewrite_pluginfile_urls($template->description, + 'pluginfile.php', + \context_system::instance()->id, + 'format_kickstart', + 'description', + $template->id), $template->descriptionformat); $tags = []; foreach (\core_tag_tag::get_item_tags('format_kickstart', 'format_kickstart_template', $template->id) as $tag) { $tags[] = '#' . $tag->get_display_name(false); diff --git a/classes/output/renderer.php b/classes/output/renderer.php index 5e1edd3..9ee90d6 100644 --- a/classes/output/renderer.php +++ b/classes/output/renderer.php @@ -24,7 +24,7 @@ namespace format_kickstart\output; -use plugin_renderer_base; +use core_courseformat\output\section_renderer; use renderable; /** @@ -33,7 +33,7 @@ * @copyright 2021 bdecent gmbh * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class renderer extends plugin_renderer_base { +class renderer extends section_renderer { /** * Overrides the parent so that templatable widgets are handled even without their explicit render method. diff --git a/classes/template_table.php b/classes/template_table.php index 132bfde..98211a8 100644 --- a/classes/template_table.php +++ b/classes/template_table.php @@ -89,6 +89,21 @@ public function col_tags($data) { null, 'template-tags'); } + /** + * Generate description. + * @param \stdClass $data + * @return mixed + */ + public function col_description($data) { + $context = \context_system::instance(); + return format_text(file_rewrite_pluginfile_urls($data->description, + 'pluginfile.php', + $context->id, + 'format_kickstart', + 'description', + $data->id), $data->descriptionformat); + } + /** * Get any extra classes names to add to this row in the HTML. * @@ -191,7 +206,6 @@ public function col_actions($data) { */ public function query_db($pagesize, $useinitialsbar = true) { global $DB, $CFG; - list($wsql, $params) = $this->get_sql_where(); if ($wsql) { $wsql = 'AND ' . $wsql; diff --git a/db/install.xml b/db/install.xml index a963df5..33b9dd8 100644 --- a/db/install.xml +++ b/db/install.xml @@ -9,7 +9,7 @@ - + diff --git a/db/upgrade.php b/db/upgrade.php index 4831767..9a1bb83 100644 --- a/db/upgrade.php +++ b/db/upgrade.php @@ -60,9 +60,9 @@ function xmldb_format_kickstart_upgrade($oldversion) { // Define field description_format to be added to format_kickstart_template. $table = new xmldb_table('kickstart_template'); - $field = new xmldb_field('description_format', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'description'); + $field = new xmldb_field('descriptionformat', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'description'); - // Conditionally launch add field description_format. + // Conditionally launch add field descriptionformat. if (!$dbman->field_exists($table, $field)) { $dbman->add_field($table, $field); } @@ -75,7 +75,7 @@ function xmldb_format_kickstart_upgrade($oldversion) { // Define field preview_url to be added to format_kickstart_template. $table = new xmldb_table('kickstart_template'); - $field = new xmldb_field('preview_url', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'description_format'); + $field = new xmldb_field('preview_url', XMLDB_TYPE_CHAR, '255', null, null, null, null, 'descriptionformat'); // Conditionally launch add field preview_url. if (!$dbman->field_exists($table, $field)) { @@ -238,6 +238,16 @@ function xmldb_format_kickstart_upgrade($oldversion) { upgrade_plugin_savepoint(true, 2023040300, 'format', 'kickstart'); } + if ($oldversion < 2023071101) { + $table = new xmldb_table('format_kickstart_template'); + $field = new xmldb_field('description_format', XMLDB_TYPE_INTEGER, '10', null, null, null, null, 'description'); + if ($dbman->field_exists($table, $field)) { + $dbman->rename_field($table, $field, 'descriptionformat'); + } + // Kickstart savepoint reached. + upgrade_plugin_savepoint(true, 2023071101, 'format', 'kickstart'); + } + format_kickstart_import_courseformat_template(); return true; diff --git a/freetemplates.php b/freetemplates.php index 10e64c5..fbf3e8e 100644 --- a/freetemplates.php +++ b/freetemplates.php @@ -41,7 +41,7 @@ 'includesubcategories' => 0, 'restrictrole' => 0, 'roleids' => [], - 'description_format' => 1, + 'descriptionformat' => 1, ), ]; diff --git a/lang/en/format_kickstart.php b/lang/en/format_kickstart.php index bf43a24..9566165 100644 --- a/lang/en/format_kickstart.php +++ b/lang/en/format_kickstart.php @@ -49,7 +49,7 @@ $string['description'] = 'Description'; $string['edit'] = 'Edit'; $string['edit_template'] = 'Edit template'; -$string['enrollmenthelp'] = 'Before continuing you may enroll teachers (or any users). Click Course in the secondary navigation to choose a template to import.'; +$string['enrollmenthelp'] = 'Before continuing you may enroll teachers (or any users). Click Proceed to course content to choose a template to import.'; $string['general_settings'] = 'General settings'; $string['getpro'] = 'Get more templates with Kickstart Pro'; $string['goprotoenable'] = 'Go Pro to enable'; diff --git a/lib.php b/lib.php index 4a962b8..750f1cb 100644 --- a/lib.php +++ b/lib.php @@ -575,3 +575,30 @@ function format_kickstart_get_designer_coursetypes() { return $coursetypes; } } + + +/** + * Serves file from. + * + * @param mixed $course course or id of the course + * @param mixed $cm course module or id of the course module + * @param context $context Context used in the file. + * @param string $filearea Filearea the file stored + * @param array $args Arguments + * @param bool $forcedownload Force download the file instead of display. + * @param array $options additional options affecting the file serving + * @return bool false if file not found, does not return if found - just send the file + */ +function format_kickstart_pluginfile($course, $cm, $context, $filearea, $args, $forcedownload, array $options = array()) { + require_login(); + if ($context->contextlevel != CONTEXT_SYSTEM && $filearea != 'description') { + return false; + } + + $fs = get_file_storage(); + $file = $fs->get_file($context->id, 'format_kickstart', $filearea, $args[0], '/', $args[1]); + if (!$file) { + return false; + } + send_stored_file($file, 0, 0, 0, $options); +} diff --git a/styles.css b/styles.css index 6fc35a3..49f6af4 100644 --- a/styles.css +++ b/styles.css @@ -57,7 +57,9 @@ body.format-kickstart .form-control .fa-search { border: 1px solid rgba(0, 0, 0, .125); margin-bottom: .5rem; } - +.format-kickstart .course-content > a { + float: right; +} .format-kickstart .card-deck .carousel-inner { display: flex; margin-bottom: .5rem; @@ -121,7 +123,19 @@ body.format-kickstart .form-control .fa-search { flex: 1 1 auto; padding: 1.25rem; } - +.format-kickstart .card-body .card-title { + margin-top: 10px; + margin-bottom: 0; +} +.format-kickstart .course-content > .card .card-body { + text-align: right; +} +.format-kickstart .course-content > .card .card-body .card-title { + text-align: left; + margin-top: 5px; + margin-bottom: 9px; + margin-right: 5px; +} .format-kickstart .card-footer { padding: .75rem 1.25rem; background-color: rgba(0, 0, 0, .03); @@ -136,8 +150,10 @@ body.format-kickstart .form-control .fa-search { .mform > .form-group { margin-left: 1.5rem; } + .format-kickstart .course-content > .card .card-body .card-title { + float: left; + } } - body#page-course-format-kickstart-template.template-designer-format #fitem_id_coursetype { display: none; } @@ -200,4 +216,10 @@ body#page-course-format-kickstart-template.template-designer-format #fitem_id_co } .format-kickstart .course-content .kickstart-list-view .templates-block .card .card-footer a.btn-outline-primary { margin-left: 10px; +} +#page-admin-course-format-kickstart-templates .generaltable tbody tr td .singlebutton { + margin-right: 10px; +} +#page-admin-course-format-kickstart-templates .generaltable tbody tr td .singlebutton + .singlebutton { + margin: 10px 0; } \ No newline at end of file diff --git a/template.php b/template.php index 722ed33..7c34dff 100644 --- a/template.php +++ b/template.php @@ -24,6 +24,7 @@ require(__DIR__.'/../../../config.php'); require_once(__DIR__.'/lib.php'); +require_once($CFG->libdir . "/formslib.php"); global $USER, $DB, $CFG; @@ -44,6 +45,10 @@ require_once($CFG->dirroot."/local/kickstart_pro/lib.php"); } +$editoroptions = array('maxfiles' => EDITOR_UNLIMITED_FILES, 'maxbytes' => $CFG->maxbytes, +'trusttext' => false, 'noclean' => true, 'context' => $context); + + switch ($action) { case 'create': $PAGE->set_title(get_string('create_template', 'format_kickstart')); @@ -53,11 +58,12 @@ redirect(new moodle_url('/course/format/kickstart/buypro.php')); } - $form = new \format_kickstart\form\template_form($PAGE->url, ['templatebgoptions' => $templatebgoptions]); + $form = new \format_kickstart\form\template_form($PAGE->url, ['templatebgoptions' => $templatebgoptions, + 'editoroptions' => $editoroptions]); if ($data = $form->get_data()) { - $data->description_format = $data->description['format']; - $data->description = $data->description['text']; + $data->description = $data->description_editor['text']; + $data->descriptionformat = $data->description_editor['format']; $counttemplate = $DB->count_records("format_kickstart_template"); if (format_kickstart_has_pro()) { $data->cohortids = json_encode($data->cohortids); @@ -77,21 +83,33 @@ file_save_draft_area_files($data->templatebackimg, $context->id, 'local_kickstart_pro', 'templatebackimg', $id, $templatebgoptions); } + + // Update the description editor. + $data = file_postupdate_standard_editor($data, 'description', $editoroptions, + $context, 'format_kickstart', 'description', $id); + $upd = new stdClass(); + $upd->id = $id; + $upd->description = $data->description; + $upd->descriptionformat = $data->descriptionformat; + $DB->update_record('format_kickstart_template', $upd); \core\notification::success(get_string('template_created', 'format_kickstart')); redirect(new moodle_url('/course/format/kickstart/templates.php')); } else if ($form->is_cancelled()) { redirect(new moodle_url('/course/format/kickstart/templates.php')); } else { + $template = new stdClass(); // Get global settings bg and set the images. if (format_kickstart_has_pro() && function_exists('local_kickstart_pro_get_template_backimages')) { - $template = new stdClass(); $templateoptions = array('maxfiles' => 10, 'subdirs' => 0, 'accepted_types' => ['.jpg', '.png']); $draftitem = file_get_submitted_draft_itemid('templatebackimages'); file_prepare_draft_area($draftitem, \context_system::instance()->id, 'format_kickstart', 'templatebackimages', 0, $templateoptions); $template->templatebackimg = $draftitem; - $form->set_data($template); } + $editoroptions['subdirs'] = false; + $template = file_prepare_standard_editor($template, 'description', $editoroptions, + $context, 'format_kickstart', 'description', null); + $form->set_data($template); } break; @@ -107,7 +125,7 @@ $template->tags = core_tag_tag::get_item_tags_array('format_kickstart', 'format_kickstart_template', $template->id); $form = new \format_kickstart\form\template_form($PAGE->url, ['templatebgoptions' => $templatebgoptions, - 'template' => (array) $template]); + 'template' => (array) $template, 'editoroptions' => $editoroptions]); if ($data = $form->get_data()) { if (isset($data->courseformatoptions)) { @@ -117,8 +135,8 @@ $courseformat->update_course_format_options($data); format_kickstart_update_template_format_options($template); } - $data->description_format = $data->description['format']; - $data->description = $data->description['text']; + $data = file_postupdate_standard_editor($data, 'description', $editoroptions, $context, + 'format_kickstart', 'description', $data->id); if (format_kickstart_has_pro()) { $data->cohortids = json_encode($data->cohortids); $data->categoryids = json_encode($data->categoryids); @@ -138,15 +156,16 @@ $data->id, $templatebgoptions); } + + \core\notification::success(get_string('template_edited', 'format_kickstart')); redirect(new moodle_url('/course/format/kickstart/templates.php')); } else if ($form->is_cancelled()) { redirect(new moodle_url('/course/format/kickstart/templates.php')); } else { - $template->description = [ - 'text' => $template->description, - 'format' => $template->description_format - ]; + $editoroptions['subdirs'] = file_area_contains_subdirs($context, 'format_kickstart', 'description', $template->id); + $template = file_prepare_standard_editor($template, 'description', $editoroptions, + $context, 'format_kickstart', 'description', $template->id); if (format_kickstart_has_pro()) { if (function_exists('local_kickstart_pro_get_template_backimages')) { $drafteditor = file_get_submitted_draft_itemid('templatebackimg'); @@ -161,24 +180,21 @@ // Check the template is normal or course format. if (!$template->courseformat) { $draftitemid = file_get_submitted_draft_itemid('course_backup'); - file_prepare_draft_area($draftitemid, $context->id, 'format_kickstart', 'course_backups', $id, ['subdirs' => 0, 'maxfiles' => 1]); - $template->course_backup = $draftitemid; - $form->set_data($template); } else { $params['format'] = $template->format; $params['id'] = '1'; $records = format_kickstart_get_template_format_options($template); - $records = array_merge((array) $records, (array) $template); + $template = array_merge((array) $records, (array) $template); if ($params['format'] == 'designer') { require_once($CFG->dirroot."/course/format/designer/lib.php"); $coursetypes = format_kickstart_get_designer_coursetypes(); - $records['coursetype'] = array_search($template->title, $coursetypes); + $template['coursetype'] = array_search($template['title'], $coursetypes); } - $form->set_data($records); } + $form->set_data($template); } break; @@ -196,7 +212,6 @@ if ($data = $form->get_data()) { format_kickstart_remove_kickstart_templates($data->id); - \core\notification::success(get_string('template_deleted', 'format_kickstart')); redirect(new moodle_url('/course/format/kickstart/templates.php')); } else if ($form->is_cancelled()) { diff --git a/templates.php b/templates.php index e219891..e523b71 100644 --- a/templates.php +++ b/templates.php @@ -36,12 +36,10 @@ $context = context_system::instance(); $PAGE->set_context($context); $PAGE->set_url(new moodle_url('/course/format/kickstart/templates.php')); - // Check the template add or not. format_kickstart_check_format_template(); $templates = isset($CFG->kickstart_templates) ? explode(",", $CFG->kickstart_templates) : []; $templates = array_values(array_filter(array_unique($templates), 'strlen')); - // Template sort action. if ($action && $templateid) { diff --git a/templates/course_template_list.mustache b/templates/course_template_list.mustache index ca1e6da..471c9fe 100644 --- a/templates/course_template_list.mustache +++ b/templates/course_template_list.mustache @@ -29,7 +29,7 @@ "id": "2", "title": "Test", "description": "This is a test template", - "description_format": "1", + "descriptionformat": "1", "description_formatted": "This is a test template", "hashtags": "#tag1 #tag2", "isplaceholder": false, diff --git a/templates/import_course_list.mustache b/templates/import_course_list.mustache index 22dfcca..a70c8e4 100644 --- a/templates/import_course_list.mustache +++ b/templates/import_course_list.mustache @@ -28,7 +28,7 @@ "id": "2", "title": "Test", "description": "This is a test template", - "description_format": "1", + "descriptionformat": "1", "description_formatted": "This is a test template", "hashtags": "#tag1 #tag2", "isplaceholder": false, @@ -59,9 +59,9 @@ {{#courses}} {{/courses}} diff --git a/tests/behat/format_kickstart_visibility.feature b/tests/behat/format_kickstart_visibility.feature index 868acd5..58a3bac 100644 --- a/tests/behat/format_kickstart_visibility.feature +++ b/tests/behat/format_kickstart_visibility.feature @@ -37,6 +37,7 @@ Feature: Check the kickstart course format features. Given I log in as "admin" And I create a kickstart template with: | Title | Test template 1 | + | Course backup file (.mbz) | /course/format/kickstart/tests/course.mbz| Then I should see "Template successfully created" Then I should see "Test template 1" in the "#templates_r5" "css_element" And I click on "#templates_r5 .singlebutton:nth-child(1)" "css_element" in the "Test template 1" "table_row" @@ -94,19 +95,23 @@ Feature: Check the kickstart course format features. And I press "Create template" And I set the following fields to these values: | Title | Test template 1| + And I upload "/course/format/kickstart/tests/course.mbz" file to "Course backup file (.mbz)" filemanager And I press "Save changes" And I should see "Template successfully created" And I press "Create template" And I set the following fields to these values: | Title | Test template 2| + And I upload "/course/format/kickstart/tests/course.mbz" file to "Course backup file (.mbz)" filemanager And I press "Save changes" And I press "Create template" And I set the following fields to these values: | Title | Test template 3| + And I upload "/course/format/kickstart/tests/course.mbz" file to "Course backup file (.mbz)" filemanager And I press "Save changes" And I press "Create template" And I set the following fields to these values: | Title | Test template 4| + And I upload "/course/format/kickstart/tests/course.mbz" file to "Course backup file (.mbz)" filemanager And I press "Save changes" And I should see "You are using the maximum number (4) of templates allowed in Kickstart free edition." And I press "Create template" diff --git a/tests/format_kickstart_test.php b/tests/format_kickstart_test.php index 0bac8c3..07efab6 100644 --- a/tests/format_kickstart_test.php +++ b/tests/format_kickstart_test.php @@ -62,7 +62,7 @@ public function test_importing() { $template = new \stdClass(); $template->title = ''; $template->description = ''; - $template->description_format = ''; + $template->descriptionformat = ''; $template->id = $DB->insert_record('format_kickstart_template', $template); $fs = get_file_storage(); @@ -149,7 +149,7 @@ public function format_format_kickstart_template_info() { 'includesubcategories' => 0, 'restrictrole' => 0, 'roleids' => [], - 'description_format' => 1, + 'descriptionformat' => 1, ); return (object) $template; } diff --git a/version.php b/version.php index 2c8de02..b10455d 100644 --- a/version.php +++ b/version.php @@ -24,9 +24,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2023061700; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2023071200; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2022041900; // Requires this Moodle version. $plugin->release = 'Version 1.3'; $plugin->component = 'format_kickstart'; // Full name of the plugin (used for diagnostics). -$plugin->supported = [40, 401]; +$plugin->supported = [40, 401, 402]; $plugin->maturity = MATURITY_STABLE; From 271e4ce7451fff383387c12e4c8b9302ff0fec24 Mon Sep 17 00:00:00 2001 From: Nithy1anand Date: Wed, 12 Jul 2023 17:10:09 +0530 Subject: [PATCH 3/7] Update the plug-in CI. --- .github/workflows/moodle-ci.yml | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index 9600fea..07344a0 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -29,29 +29,35 @@ jobs: matrix: include: - php: '8.0' - moodle-branch: 'MOODLE_400_STABLE' + moodle-branch: 'MOODLE_402_STABLE' database: 'mariadb' - php: '8.0' - moodle-branch: 'MOODLE_401_STABLE' + moodle-branch: 'MOODLE_402_STABLE' + database: 'pgsql' + - php: '7.4' + moodle-branch: 'MOODLE_402_STABLE' + database: 'pgsql' + - php: '7.4' + moodle-branch: 'MOODLE_402_STABLE' database: 'mariadb' - php: '8.0' - moodle-branch: 'master' + moodle-branch: 'MOODLE_401_STABLE' database: 'mariadb' - - php: '8.0' - moodle-branch: 'MOODLE_400_STABLE' - database: 'pgsql' - php: '8.0' moodle-branch: 'MOODLE_401_STABLE' database: 'pgsql' - - php: '8.0' - moodle-branch: 'master' - database: 'pgsql' - php: '7.4' moodle-branch: 'MOODLE_401_STABLE' database: 'pgsql' - php: '7.4' moodle-branch: 'MOODLE_401_STABLE' database: 'mariadb' + - php: '8.0' + moodle-branch: 'MOODLE_400_STABLE' + database: 'mariadb' + - php: '8.0' + moodle-branch: 'MOODLE_400_STABLE' + database: 'pgsql' - php: '7.4' moodle-branch: 'MOODLE_400_STABLE' database: 'pgsql' @@ -118,9 +124,9 @@ jobs: if: ${{ always() }} run: moodle-plugin-ci mustache - # - name: Grunt - # if: ${{ always() }} - # run: moodle-plugin-ci grunt + - name: Grunt + if: ${{ always() }} + run: moodle-plugin-ci grunt - name: PHPUnit tests if: ${{ always() }} From 797daa8d953bcfd0b54b1847866030ec785dfb22 Mon Sep 17 00:00:00 2001 From: Nithy1anand Date: Wed, 12 Jul 2023 17:57:08 +0530 Subject: [PATCH 4/7] Update the Plugin CI. --- .github/workflows/moodle-ci.yml | 24 ------------------------ 1 file changed, 24 deletions(-) diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index 07344a0..45cef79 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -40,30 +40,6 @@ jobs: - php: '7.4' moodle-branch: 'MOODLE_402_STABLE' database: 'mariadb' - - php: '8.0' - moodle-branch: 'MOODLE_401_STABLE' - database: 'mariadb' - - php: '8.0' - moodle-branch: 'MOODLE_401_STABLE' - database: 'pgsql' - - php: '7.4' - moodle-branch: 'MOODLE_401_STABLE' - database: 'pgsql' - - php: '7.4' - moodle-branch: 'MOODLE_401_STABLE' - database: 'mariadb' - - php: '8.0' - moodle-branch: 'MOODLE_400_STABLE' - database: 'mariadb' - - php: '8.0' - moodle-branch: 'MOODLE_400_STABLE' - database: 'pgsql' - - php: '7.4' - moodle-branch: 'MOODLE_400_STABLE' - database: 'pgsql' - - php: '7.4' - moodle-branch: 'MOODLE_400_STABLE' - database: 'mariadb' steps: - name: Check out repository code From 490d6e1e4ab737d759410fa37efec7b623b7c5f4 Mon Sep 17 00:00:00 2001 From: Nithy1anand Date: Wed, 12 Jul 2023 18:40:21 +0530 Subject: [PATCH 5/7] version file update --- version.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/version.php b/version.php index b10455d..ba1612a 100644 --- a/version.php +++ b/version.php @@ -24,9 +24,9 @@ defined('MOODLE_INTERNAL') || die(); -$plugin->version = 2023071200; // The current plugin version (Date: YYYYMMDDXX). +$plugin->version = 2023071201; // The current plugin version (Date: YYYYMMDDXX). $plugin->requires = 2022041900; // Requires this Moodle version. $plugin->release = 'Version 1.3'; $plugin->component = 'format_kickstart'; // Full name of the plugin (used for diagnostics). -$plugin->supported = [40, 401, 402]; +$plugin->supported = [40, 402]; $plugin->maturity = MATURITY_STABLE; From 8f7a1169c9406bcff04dad2bebe44999d12ac286 Mon Sep 17 00:00:00 2001 From: Nithy1anand Date: Thu, 13 Jul 2023 10:11:59 +0530 Subject: [PATCH 6/7] Update the CI. --- .github/workflows/moodle-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index 45cef79..3ca6039 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -4,11 +4,11 @@ on: [push, pull_request] jobs: test: - runs-on: ubuntu-18.04 + runs-on: ubuntu-20.04 services: postgres: - image: postgres:13 + image: postgres:13.0 env: POSTGRES_USER: 'postgres' POSTGRES_HOST_AUTH_METHOD: 'trust' From edb08664fa1a0074089a11ed7281e73fe5c01558 Mon Sep 17 00:00:00 2001 From: Nithy1anand Date: Thu, 13 Jul 2023 11:48:07 +0530 Subject: [PATCH 7/7] CI update --- .github/workflows/moodle-ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/moodle-ci.yml b/.github/workflows/moodle-ci.yml index 3ca6039..e023fb2 100644 --- a/.github/workflows/moodle-ci.yml +++ b/.github/workflows/moodle-ci.yml @@ -34,12 +34,6 @@ jobs: - php: '8.0' moodle-branch: 'MOODLE_402_STABLE' database: 'pgsql' - - php: '7.4' - moodle-branch: 'MOODLE_402_STABLE' - database: 'pgsql' - - php: '7.4' - moodle-branch: 'MOODLE_402_STABLE' - database: 'mariadb' steps: - name: Check out repository code