@@ -11,15 +11,16 @@ class PortfolioNotifier
1111 public static function notifyTeachersAndAuthor (PortfolioComment $ comment )
1212 {
1313 $ item = $ comment ->getItem ();
14- $ course = $ item ->getCourse ();
15- $ session = $ item ->getSession ();
14+ $ itemResourceLink = $ item ->getFirstResourceLink ();
15+ $ course = $ itemResourceLink ->getCourse ();
16+ $ session = $ itemResourceLink ->getSession ();
1617
1718 $ messageSubject = sprintf (
1819 get_lang ('[Portfolio] New comment in post %s ' ),
1920 $ item ->getTitle (true )
2021 );
2122 $ userIdListToSend = [];
22- $ userIdListToSend [] = $ comment ->getItem ()->getUser ()->getId ();
23+ $ userIdListToSend [] = $ comment ->getItem ()->resourceNode -> getCreator ()->getId ();
2324
2425 $ cidreq = api_get_cidreq_params (
2526 $ course ? $ course ->getCode () : '' ,
@@ -58,7 +59,7 @@ public static function notifyTeachersAndAuthor(PortfolioComment $comment)
5859
5960 $ messageContent .= '<br><br><figure> '
6061 .'<blockquote> ' .$ comment ->getExcerpt ().'</blockquote> '
61- .'<figcaption> ' .$ comment ->getAuthor ()->getFullName ().'</figcaption> '
62+ .'<figcaption> ' .$ comment ->resourceNode -> getCreator ()->getFullName ().'</figcaption> '
6263 .'</figure> ' ;
6364
6465 foreach ($ userIdListToSend as $ userIdToSend ) {
@@ -69,7 +70,6 @@ public static function notifyTeachersAndAuthor(PortfolioComment $comment)
6970 0 ,
7071 false ,
7172 false ,
72- [],
7373 false
7474 );
7575 }
@@ -78,7 +78,7 @@ public static function notifyTeachersAndAuthor(PortfolioComment $comment)
7878 private static function getCourseTitle (CourseEntity $ course , ?SessionEntity $ session = null ): string
7979 {
8080 if ($ session ) {
81- return "{$ course ->getTitle ()} ( {$ session ->getName ()}) " ;
81+ return "{$ course ->getTitle ()} ( {$ session ->getTitle ()}) " ;
8282 }
8383
8484 return $ course ->getTitle ();
0 commit comments