mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-39954 event: Fixed errors raised while triggering event
This commit is contained in:
parent
dde244c046
commit
29b8b7c7ad
3 changed files with 4 additions and 16 deletions
|
@ -22,7 +22,7 @@
|
||||||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace assignment_submitted\event;
|
namespace assignment_upload\event;
|
||||||
|
|
||||||
defined('MOODLE_INTERNAL') || die();
|
defined('MOODLE_INTERNAL') || die();
|
||||||
|
|
||||||
|
|
|
@ -63,8 +63,8 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
|
||||||
$eventdata->itemid = $this->objectid;
|
$eventdata->itemid = $this->objectid;
|
||||||
$eventdata->courseid = $this->courseid;
|
$eventdata->courseid = $this->courseid;
|
||||||
$eventdata->userid = $this->userid;
|
$eventdata->userid = $this->userid;
|
||||||
if ($this->get_legacy_files()) {
|
if ($this->legacyfiles) {
|
||||||
$eventdata->files = $this->get_legacy_files(); // This is depreceated - please use pathnamehashes instead!
|
$eventdata->files = $this->legacyfiles; // This is depreceated - please use pathnamehashes instead!
|
||||||
}
|
}
|
||||||
$eventdata->pathnamehashes = $this->other['pathnamehashes'];
|
$eventdata->pathnamehashes = $this->other['pathnamehashes'];
|
||||||
return $eventdata;
|
return $eventdata;
|
||||||
|
@ -127,16 +127,4 @@ class assessable_uploaded extends \core\event\assessable_uploaded {
|
||||||
$this->legacyfiles = $files;
|
$this->legacyfiles = $files;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Custom validation
|
|
||||||
*
|
|
||||||
* @throws coding_exception
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
protected function validate_data() {
|
|
||||||
parent::validate_data();
|
|
||||||
if (!isset($this->other['triggeredfrom'])) {
|
|
||||||
throw new coding_exception('triggeredfrom must be set in $other');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -218,7 +218,7 @@ if ($edit) {
|
||||||
'objectid' => $submission->id,
|
'objectid' => $submission->id,
|
||||||
'other' => array(
|
'other' => array(
|
||||||
'content' => $formdata->content,
|
'content' => $formdata->content,
|
||||||
'files' => array_keys($files)
|
'pathnamehashes' => array_keys($files)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$event = \mod_workshop\event\assessable_uploaded::create($params);
|
$event = \mod_workshop\event\assessable_uploaded::create($params);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue