Skip to content

Commit

Permalink
Set current courseid when importing a custom SQL report.
Browse files Browse the repository at this point in the history
  • Loading branch information
reskit committed Nov 21, 2022
1 parent f63cf94 commit 267c294
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions locallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,8 @@ function cr_import_xml($xml, $course) {
if (array_key_exists('customsql', $tempcomponents)) {
$tempcomponents['customsql']['config']->querysql = str_replace("\'", "'", $tempcomponents['customsql']['config']->querysql);
$tempcomponents['customsql']['config']->querysql = str_replace('\"', '"', $tempcomponents['customsql']['config']->querysql);
// Set current courseid.
$tempcomponents['customsql']['config']->courseid = $course->id;
}
$val[0]['#'] = cr_serialize($tempcomponents);
}
Expand Down

2 comments on commit 267c294

@luisdev
Copy link

@luisdev luisdev commented on 267c294 Sep 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @reskit.
Was there a specific reason for making this change to your branch? Does this fix a bug?

@reskit
Copy link
Contributor Author

@reskit reskit commented on 267c294 Sep 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit resolves this bug

Please sign in to comment.