@@ -867,6 +867,7 @@ function gdn_dispatcher_beforeControllerMethod_handler($sender, $args){
867
867
]);
868
868
869
869
$ groupID = false ;
870
+ $ categoryModel = new CategoryModel ();
870
871
if ($ args ['Controller ' ] instanceof DiscussionController) {
871
872
if (array_key_exists ('discussionid ' , $ methodArgs )) {
872
873
$ discussionID = $ methodArgs ['discussionid ' ];
@@ -888,7 +889,6 @@ function gdn_dispatcher_beforeControllerMethod_handler($sender, $args){
888
889
$ discussionModel = new DiscussionModel ();
889
890
$ discussion = $ discussionModel ->getID ($ discussionID );
890
891
if ($ discussion ->CategoryID ){
891
- $ categoryModel = new CategoryModel ();
892
892
$ category = $ categoryModel ->getID ($ discussion ->CategoryID );
893
893
$ groupID = $ category ->GroupID ;
894
894
}
@@ -899,16 +899,28 @@ function gdn_dispatcher_beforeControllerMethod_handler($sender, $args){
899
899
$ discussionModel = new DiscussionModel ();
900
900
$ discussion = $ discussionModel ->getID ($ comment ->DiscussionID );
901
901
if ($ discussion ->CategoryID ){
902
- $ categoryModel = new CategoryModel ();
903
902
$ category = $ categoryModel ->getID ($ discussion ->CategoryID );
904
903
$ groupID = $ category ->GroupID ;
905
904
}
906
905
}
906
+ } else if ($ args ['Controller ' ] instanceof CategoriesController) {
907
+ if (array_key_exists ('categoryidentifier ' , $ methodArgs )) {
908
+ $ categoryUrlCode = $ methodArgs ['categoryidentifier ' ];
909
+ if ($ categoryUrlCode ) {
910
+ $ category = $ categoryModel ->getByCode ($ categoryUrlCode );
911
+ $ groupID = val ('GroupID ' , $ category );
912
+ }
913
+ }
907
914
}
908
915
909
916
if ($ groupID && $ groupID > 0 ) {
910
917
$ groupModel = new GroupModel ();
911
918
$ group = $ groupModel ->getByGroupID ($ groupID );
919
+ $ category = $ categoryModel ->getByCode ($ group ->ChallengeID );
920
+ $ categoryID = val ('CategoryID ' , $ category );
921
+ Gdn::controller ()->setData ('Breadcrumbs.Options.GroupCategoryID ' , $ categoryID );
922
+ Gdn::controller ()->setData ('Breadcrumbs.Options.GroupID ' , $ groupID );
923
+ Gdn::controller ()->setData ('Breadcrumbs.Options.ChallengeID ' , $ group ->ChallengeID );
912
924
if ($ group ->ChallengeID ) {
913
925
$ this ->setTopcoderProjectData ($ args ['Controller ' ], $ group ->ChallengeID );
914
926
}
@@ -1547,6 +1559,7 @@ public function getChallenge($challengeId) {
1547
1559
}
1548
1560
$ cachedChallenge ['StartDate ' ] = $ startDate ;
1549
1561
$ cachedChallenge ['EndDate ' ] = $ endDate ;
1562
+ $ cachedChallenge ['Track ' ] = $ challenge ->track ;
1550
1563
$ termIDs = array_column ($ challenge ->terms , 'id ' );
1551
1564
$ NDA_UUID = c ('Plugins.Topcoder.NDA_UUID ' );
1552
1565
$ cachedChallenge ['IsNDA ' ] = in_array ($ NDA_UUID , $ termIDs );
0 commit comments