@@ -827,6 +827,12 @@ public function userController_UserCell_handler($sender, $args) {
827
827
<?php
828
828
}
829
829
830
+ /**
831
+ * Load resource roles and challenge roles by challengeID from Topcoder services
832
+ * and set data to sender.
833
+ * @param $sender
834
+ * @param $args
835
+ */
830
836
function gdn_dispatcher_beforeControllerMethod_handler ($ sender , $ args ){
831
837
if (!c ('Garden.Installed ' )){
832
838
return ;
@@ -857,7 +863,16 @@ function gdn_dispatcher_beforeControllerMethod_handler($sender, $args){
857
863
$ groupID = (int ) $ methodArgs ['groupid ' ];
858
864
}
859
865
} else if ($ args ['Controller ' ] instanceof PostController) {
860
- if (array_key_exists ('commentid ' , $ methodArgs )) {
866
+ if (array_key_exists ('discussionid ' , $ methodArgs )) {
867
+ $ discussionID = $ methodArgs ['discussionid ' ];
868
+ $ discussionModel = new DiscussionModel ();
869
+ $ discussion = $ discussionModel ->getID ($ discussionID );
870
+ if ($ discussion ->CategoryID ){
871
+ $ categoryModel = new CategoryModel ();
872
+ $ category = $ categoryModel ->getID ($ discussion ->CategoryID );
873
+ $ groupID = $ category ->GroupID ;
874
+ }
875
+ } else if (array_key_exists ('commentid ' , $ methodArgs )) {
861
876
$ commentID = $ methodArgs ['commentid ' ];
862
877
$ commentModel = new CommentModel ();
863
878
$ comment = $ commentModel ->getID ($ commentID );
0 commit comments