Skip to content

Commit ef2d821

Browse files
committed
Moodle 4.4 compatibilty fixes for hsuforum
Removed some of the depricated functions and depricated strings that were causing test cases to fail when running on moodle 4.4 Fixed some the test cases as well which were using deprecated functions
1 parent 0fdbf04 commit ef2d821

37 files changed

+47
-252
lines changed

classes/event/assessable_uploaded.php

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -54,35 +54,6 @@ public function get_description() {
5454
"'$this->contextinstanceid'.";
5555
}
5656

57-
/**
58-
* Legacy event data if get_legacy_eventname() is not empty.
59-
*
60-
* @return \stdClass
61-
*/
62-
protected function get_legacy_eventdata() {
63-
$eventdata = new \stdClass();
64-
$eventdata->modulename = 'hsuforum';
65-
$eventdata->name = $this->other['triggeredfrom'];
66-
$eventdata->cmid = $this->contextinstanceid;
67-
$eventdata->itemid = $this->objectid;
68-
$eventdata->courseid = $this->courseid;
69-
$eventdata->userid = $this->userid;
70-
$eventdata->content = $this->other['content'];
71-
if ($this->other['pathnamehashes']) {
72-
$eventdata->pathnamehashes = $this->other['pathnamehashes'];
73-
}
74-
return $eventdata;
75-
}
76-
77-
/**
78-
* Return the legacy event name.
79-
*
80-
* @return string
81-
*/
82-
public static function get_legacy_eventname() {
83-
return 'assessable_content_uploaded';
84-
}
85-
8657
/**
8758
* Return localised event name.
8859
*

classes/event/course_module_viewed.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,17 +55,6 @@ protected function init() {
5555
public function get_url() {
5656
return new \moodle_url('/mod/hsuforum/view.php', array('f' => $this->objectid));
5757
}
58-
59-
/**
60-
* Return the legacy event log data.
61-
*
62-
* @return array|null
63-
*/
64-
protected function get_legacy_logdata() {
65-
return array($this->courseid, 'hsuforum', 'view forum', 'view.php?f=' . $this->objectid,
66-
$this->objectid, $this->contextinstanceid);
67-
}
68-
6958
public static function get_objectid_mapping() {
7059
return array('db' => 'hsuforum', 'restore' => 'hsuforum');
7160
}

classes/event/course_searched.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,6 @@ public function get_url() {
8282
array('id' => $this->courseid, 'search' => $this->other['searchterm']));
8383
}
8484

85-
/**
86-
* Return the legacy event log data.
87-
*
88-
* @return array|null
89-
*/
90-
protected function get_legacy_logdata() {
91-
// The legacy log table expects a relative path to /mod/hsuforum/.
92-
$logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/'));
93-
94-
return array($this->courseid, 'hsuforum', 'search', $logurl, $this->other['searchterm']);
95-
}
96-
9785
/**
9886
* Custom validation.
9987
*

classes/event/discussion_created.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,19 +80,6 @@ public function get_url() {
8080
return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid));
8181
}
8282

83-
/**
84-
* Return the legacy event log data.
85-
*
86-
* @return array|null
87-
*/
88-
protected function get_legacy_logdata() {
89-
90-
// The legacy log table expects a relative path to /mod/hsuforum/.
91-
$logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/'));
92-
93-
return array($this->courseid, 'hsuforum', 'add discussion', $logurl, $this->objectid, $this->contextinstanceid);
94-
}
95-
9683
/**
9784
* Custom validation.
9885
*

classes/event/discussion_deleted.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,6 @@ public function get_url() {
8181
return new \moodle_url('/mod/hsuforum/view.php', array('id' => $this->contextinstanceid));
8282
}
8383

84-
/**
85-
* Return the legacy event log data.
86-
*
87-
* @return array|null
88-
*/
89-
protected function get_legacy_logdata() {
90-
return array($this->courseid, 'hsuforum', 'delete discussion', 'view.php?id=' . $this->contextinstanceid,
91-
$this->other['forumid'], $this->contextinstanceid);
92-
}
93-
9484
/**
9585
* Custom validation.
9686
*

classes/event/discussion_moved.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -81,16 +81,6 @@ public function get_url() {
8181
return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid));
8282
}
8383

84-
/**
85-
* Return the legacy event log data.
86-
*
87-
* @return array|null
88-
*/
89-
protected function get_legacy_logdata() {
90-
return array($this->courseid, 'hsuforum', 'move discussion', 'discuss.php?d=' . $this->objectid,
91-
$this->objectid, $this->contextinstanceid);
92-
}
93-
9484
/**
9585
* Custom validation.
9686
*

classes/event/discussion_pinned.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,6 @@ public function get_url() {
7070
return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid));
7171
}
7272

73-
/**
74-
* Return the legacy event log data.
75-
*
76-
* @return array|null
77-
*/
78-
protected function get_legacy_logdata() {
79-
// The legacy log table expects a relative path to /mod/hsuforum/.
80-
$logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/'));
81-
return array($this->courseid, 'hsuforum', 'pin discussion', $logurl, $this->objectid, $this->contextinstanceid);
82-
}
83-
8473
/**
8574
* Custom validation.
8675
*

classes/event/discussion_unpinned.php

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,6 @@ public function get_url() {
7070
return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid));
7171
}
7272

73-
/**
74-
* Return the legacy event log data.
75-
*
76-
* @return array|null
77-
*/
78-
protected function get_legacy_logdata() {
79-
// The legacy log table expects a relative path to /mod/hsuforum/.
80-
$logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/'));
81-
return array($this->courseid, 'hsuforum', 'unpin discussion', $logurl, $this->objectid, $this->contextinstanceid);
82-
}
83-
8473
/**
8574
* Custom validation.
8675
*

classes/event/discussion_viewed.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -75,16 +75,6 @@ public function get_url() {
7575
return new \moodle_url('/mod/hsuforum/discuss.php', array('d' => $this->objectid));
7676
}
7777

78-
/**
79-
* Return the legacy event log data.
80-
*
81-
* @return array|null
82-
*/
83-
protected function get_legacy_logdata() {
84-
return array($this->courseid, 'hsuforum', 'view discussion', 'discuss.php?d=' . $this->objectid,
85-
$this->objectid, $this->contextinstanceid);
86-
}
87-
8878
/**
8979
* Custom validation.
9080
*

classes/event/post_created.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,6 @@ public function get_url() {
9191
return $url;
9292
}
9393

94-
/**
95-
* Return the legacy event log data.
96-
*
97-
* @return array|null
98-
*/
99-
protected function get_legacy_logdata() {
100-
// The legacy log table expects a relative path to /mod/hsuforum/.
101-
$logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/'));
102-
103-
return array($this->courseid, 'hsuforum', 'add post', $logurl, $this->other['forumid'], $this->contextinstanceid);
104-
}
105-
10694
/**
10795
* Custom validation.
10896
*

classes/event/post_deleted.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,6 @@ public function get_url() {
9090
return $url;
9191
}
9292

93-
/**
94-
* Return the legacy event log data.
95-
*
96-
* @return array|null
97-
*/
98-
protected function get_legacy_logdata() {
99-
// The legacy log table expects a relative path to /mod/hsuforum/.
100-
$logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/'));
101-
102-
return array($this->courseid, 'hsuforum', 'delete post', $logurl, $this->objectid, $this->contextinstanceid);
103-
}
104-
10593
/**
10694
* Custom validation.
10795
*

classes/event/post_updated.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -91,18 +91,6 @@ public function get_url() {
9191
return $url;
9292
}
9393

94-
/**
95-
* Return the legacy event log data.
96-
*
97-
* @return array|null
98-
*/
99-
protected function get_legacy_logdata() {
100-
// The legacy log table expects a relative path to /mod/hsuforum/.
101-
$logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/'));
102-
103-
return array($this->courseid, 'hsuforum', 'update post', $logurl, $this->objectid, $this->contextinstanceid);
104-
}
105-
10694
/**
10795
* Custom validation.
10896
*

classes/event/readtracking_disabled.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,6 @@ public function get_url() {
7979
return new \moodle_url('/mod/hsuforum/view.php', array('f' => $this->other['forumid']));
8080
}
8181

82-
/**
83-
* Return the legacy event log data.
84-
*
85-
* @return array|null
86-
*/
87-
protected function get_legacy_logdata() {
88-
return array($this->courseid, 'hsuforum', 'stop tracking', 'view.php?f=' . $this->other['forumid'],
89-
$this->other['forumid'], $this->contextinstanceid);
90-
}
91-
9282
/**
9383
* Custom validation.
9484
*

classes/event/readtracking_enabled.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -79,16 +79,6 @@ public function get_url() {
7979
return new \moodle_url('/mod/hsuforum/view.php', array('f' => $this->other['forumid']));
8080
}
8181

82-
/**
83-
* Return the legacy event log data.
84-
*
85-
* @return array|null
86-
*/
87-
protected function get_legacy_logdata() {
88-
return array($this->courseid, 'hsuforum', 'start tracking', 'view.php?f=' . $this->other['forumid'],
89-
$this->other['forumid'], $this->contextinstanceid);
90-
}
91-
9282
/**
9383
* Custom validation.
9484
*

classes/event/subscribers_viewed.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,6 @@ public function get_url() {
8080
return new \moodle_url('/mod/hsuforum/subscribers.php', array('id' => $this->other['forumid']));
8181
}
8282

83-
/**
84-
* Return the legacy event log data.
85-
*
86-
* @return array|null
87-
*/
88-
protected function get_legacy_logdata() {
89-
return array($this->courseid, 'hsuforum', 'view subscribers', 'subscribers.php?id=' . $this->other['forumid'],
90-
$this->other['forumid'], $this->contextinstanceid);
91-
}
92-
9383
/**
9484
* Custom validation.
9585
*

classes/event/subscription_created.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,6 @@ public function get_url() {
8080
return new \moodle_url('/mod/hsuforum/subscribers.php', array('id' => $this->other['forumid']));
8181
}
8282

83-
/**
84-
* Return the legacy event log data.
85-
*
86-
* @return array|null
87-
*/
88-
protected function get_legacy_logdata() {
89-
return array($this->courseid, 'hsuforum', 'subscribe', 'view.php?f=' . $this->other['forumid'],
90-
$this->other['forumid'], $this->contextinstanceid);
91-
}
92-
9383
/**
9484
* Custom validation.
9585
*

classes/event/subscription_deleted.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -80,16 +80,6 @@ public function get_url() {
8080
return new \moodle_url('/mod/hsuforum/subscribers.php', array('id' => $this->other['forumid']));
8181
}
8282

83-
/**
84-
* Return the legacy event log data.
85-
*
86-
* @return array|null
87-
*/
88-
protected function get_legacy_logdata() {
89-
return array($this->courseid, 'hsuforum', 'unsubscribe', 'view.php?f=' . $this->other['forumid'],
90-
$this->other['forumid'], $this->contextinstanceid);
91-
}
92-
9383
/**
9484
* Custom validation.
9585
*

classes/event/user_report_viewed.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,6 @@ public function get_url() {
8888
return $url;
8989
}
9090

91-
/**
92-
* Return the legacy event log data.
93-
*
94-
* @return array|null
95-
*/
96-
protected function get_legacy_logdata() {
97-
// The legacy log table expects a relative path to /mod/hsuforum/.
98-
$logurl = substr($this->get_url()->out_as_local_url(), strlen('/mod/hsuforum/'));
99-
100-
return array($this->courseid, 'hsuforum', 'user report', $logurl, $this->relateduserid);
101-
}
102-
10391
/**
10492
* Custom validation.
10593
*

classes/output/big_search_form.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ class big_search_form implements renderable, templatable {
5353
public $user;
5454
public $words;
5555
public $tags;
56+
57+
public $forumid;
5658
/** @var string The URL of the search form. */
5759
public $actionurl;
5860

0 commit comments

Comments
 (0)