MDL-47162 core_message: debug whenever courseid is missing
authorEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 27 Oct 2016 22:06:31 +0000 (00:06 +0200)
committerEloy Lafuente (stronk7) <stronk7@moodle.org>
Thu, 27 Oct 2016 22:30:02 +0000 (00:30 +0200)
commita29bcf781937e8e440e6baac69c7f028f52c97eb
tree4987b92eadbf681a354feead9672087e7cdbb378
parent9d0e8a4f6df6ef26ac0b31e7fe82f43206204af5
MDL-47162 core_message: debug whenever courseid is missing

Instead of silently defaulting to SITEID when courseid (coming
from message_send()/\core\message\manager::send_message()) is missing,
now a debugging message is shown to allow developers to fix their
messages to, always, include courseid.

Raw creation of events via message_sent::create() missing other[courseid]
leads to coding exception since now (there shouldn't be any legacy use, as far as
they are always created via create_from_ids() when sending a message.

Updated upgrade.txt notes a little bit, added references the 3.6 final
deprecation issue (MDL-55449) and covered with unit tests.
lib/classes/event/message_sent.php
lib/classes/message/manager.php
lib/messagelib.php
lib/upgrade.txt
message/tests/events_test.php