Skip to content
Snippets Groups Projects
Unverified Commit d78d2324 authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

Fixed manipulating array and expecting it to be in inital state after

parent 938ea1eb
Branches
Tags
No related merge requests found
...@@ -154,17 +154,19 @@ class email extends libbase { ...@@ -154,17 +154,19 @@ class email extends libbase {
// Replace courses list. // Replace courses list.
$patterns [] = '##courses##'; $patterns [] = '##courses##';
$courses = $mailentries;
$coursesstring = ''; $coursesstring = '';
$coursesstring .= $this->parse_course(array_pop($mailentries)->courseid); $coursesstring .= $this->parse_course(array_pop($courses)->courseid);
foreach ($mailentries as $entry) { foreach ($courses as $entry) {
$coursesstring .= "\n" . $this->parse_course($entry->courseid); $coursesstring .= "\n" . $this->parse_course($entry->courseid);
} }
$replacements [] = $coursesstring; $replacements [] = $coursesstring;
// Replace courses html. // Replace courses html.
$patterns [] = '##courses-html##'; $patterns [] = '##courses-html##';
$courses = $mailentries;
$coursestabledata = array(); $coursestabledata = array();
foreach ($mailentries as $entry) { foreach ($courses as $entry) {
$coursestabledata[$entry->courseid] = $this->parse_course_row_data($entry->courseid); $coursestabledata[$entry->courseid] = $this->parse_course_row_data($entry->courseid);
} }
$coursestable = new \html_table(); $coursestable = new \html_table();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment