where is course->welcomemessage assigned?

where is course->welcomemessage assigned?

by Robert Brenstein -
Number of replies: 3
The function sending enrolment welcome message (email_welcome_message_to_user() in moodlelib.php) has

if (!empty($course->welcomemessage)) {
$subject = get_string('welcometocourse', '', format_string($course->fullname));
$a->coursename = $course->fullname;
$a->profileurl = "$CFG->wwwroot/user/view.php?id=$USER->id&course=$course->id";
//$message = get_string("welcometocoursetext", "", $a);
$message = $course->welcomemessage;

I am trying to figure out where the text that is sent, that is content of $course->welcomemessage, is coming from since the string welcometocoursetext is not used here.

I must be dense. I searched left and right in Moodle 1.8 and 1.9 but I can't figure out where $course->welcomemessage is assigned. The $course variable is initiated from mdl_course record but there is no field with such a name, so it must be set somewhere in code. However, global search of all php files does not find it.
Average of ratings: -
In reply to Robert Brenstein

Re: where is course->welcomemessage assigned?

by Gary Anderson -
Hi Robert:

Good question. I put a print_r in the function to find out what is in the $course array at the time it is called, and there is no reference to welcomemessage, not even ' ' or null.

So, my guess is that this was included in older code, but is no longer relevant. I did a global search as well and agree with your conclusion (1.9 Beta 3, latest CVS update).

It would be good to post this in the tracker. There is a remote chance that it is used in some non-core enrollment module, but I doubt it.

--Gary
In reply to Gary Anderson

Re: where is course->welcomemessage assigned?

by Robert Brenstein -
Actually, after investigating thus further, I suspect that this is a side-effect of some new code trying to centralize sending the welcome email and/or to implement course-specific welcome messages. Only flatfile and paypal send welcome messages with their own code. As far as I can see, no messages are sent otherwise even when they should, like when users enroll themselves. I tested that removing the $course->welcomemessage check in email_welcome_message_to_user() reactivates sending welcome email. I filed this in bugtracker -- MDL-12703.


In reply to Robert Brenstein

This forum post has been removed

The content of this forum post has been removed and can no longer be accessed.