Skip to content

Commit

Permalink
Merge pull request #177 from learnweb/update/m42
Browse files Browse the repository at this point in the history
Update for Moodle 4.2
  • Loading branch information
NinaHerrmann authored May 23, 2023
2 parents b9447ab + 0403483 commit 160bc68
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 12 deletions.
20 changes: 16 additions & 4 deletions .github/workflows/moodle-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:

strategy:
matrix:
php: ['8.0']
moodle-branch: ['MOODLE_401_STABLE']
php: ['8.1']
moodle-branch: ['MOODLE_402_STABLE']
database: ['pgsql']

steps:
Expand Down Expand Up @@ -107,8 +107,8 @@ jobs:
strategy:
fail-fast: false
matrix:
php: ['8.0']
moodle-branch: ['MOODLE_311_STABLE', 'MOODLE_400_STABLE', 'MOODLE_401_STABLE']
php: ['8.0', '8.1']
moodle-branch: ['MOODLE_401_STABLE', 'MOODLE_402_STABLE']
database: ['mariadb', 'pgsql']
include:
- php: '7.4'
Expand All @@ -117,6 +117,18 @@ jobs:
- php: '7.4'
moodle-branch: 'MOODLE_39_STABLE'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_311_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_311_STABLE'
database: 'pgsql'
- php: '8.0'
moodle-branch: 'MOODLE_400_STABLE'
database: 'mariadb'
- php: '8.0'
moodle-branch: 'MOODLE_400_STABLE'
database: 'pgsql'

steps:
- name: Start MariaDB
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/moodle-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ jobs:
--data-urlencode "altdownloadurl=${ZIPURL}" \
--data-urlencode "releasenotes=${BODY}" \
--data-urlencode "releasenotesformat=4")
echo "::set-output name=response::${RESPONSE}"
echo "response=${RESPONSE}" >> $GITHUB_OUTPUT
- name: Evaluate the response
id: evaluate-response
env:
Expand Down
20 changes: 15 additions & 5 deletions classes/local/backup/backup_lifecycle_workflow.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public function send_temp_file() {
*/
private function write_workflow() {
foreach (get_object_vars($this->workflow) as $prop => $value) {
$this->writer->writeAttribute($prop, $value);
if (!is_null($value)) {
$this->writer->writeAttribute($prop, $value);
}
}
}

Expand All @@ -118,13 +120,17 @@ private function write_triggers() {
foreach ($this->trigger as $trigger) {
$this->writer->startElement("trigger");
foreach (get_object_vars($trigger) as $prop => $value) {
$this->writer->writeAttribute($prop, $value);
if (!is_null($value)) {
$this->writer->writeAttribute($prop, $value);
}
}
$settings = settings_manager::get_settings($trigger->id, settings_type::TRIGGER);
foreach ($settings as $name => $value) {
$this->writer->startElement("setting");
$this->writer->writeAttribute('name', $name);
$this->writer->writeAttribute('value', $value);
if (!is_null($value)) {
$this->writer->writeAttribute('value', $value);
}
$this->writer->endElement();
}
$this->writer->endElement();
Expand All @@ -139,13 +145,17 @@ private function write_steps() {
foreach ($this->steps as $step) {
$this->writer->startElement("step");
foreach (get_object_vars($step) as $prop => $value) {
$this->writer->writeAttribute($prop, $value);
if (!is_null($value)) {
$this->writer->writeAttribute($prop, $value);
}
}
$settings = settings_manager::get_settings($step->id, settings_type::STEP);
foreach ($settings as $name => $value) {
$this->writer->startElement("setting");
$this->writer->writeAttribute('name', $name);
$this->writer->writeAttribute('value', $value);
if (!is_null($value)) {
$this->writer->writeAttribute('value', $value);
}
$this->writer->endElement();
}
$this->writer->endElement();
Expand Down
4 changes: 2 additions & 2 deletions version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die;

$plugin->maturity = MATURITY_BETA;
$plugin->version = 2022112400;
$plugin->version = 2023050200;
$plugin->component = 'tool_lifecycle';
$plugin->requires = 2020061500; // Requires Moodle 3.9+.
$plugin->release = 'v4.1-r1';
$plugin->release = 'v4.2-r1';

0 comments on commit 160bc68

Please sign in to comment.