File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change 67
67
}
68
68
if (Security::check_token ('get ' )) {
69
69
$ courseInfo = api_get_course_info ($ courseCodeToSubscribe );
70
- CourseManager::autoSubscribeToCourse ($ courseCodeToSubscribe );
71
- $ redirectionTarget = CoursesAndSessionsCatalog::generateRedirectUrlAfterSubscription (
72
- $ courseInfo ['course_public_url ' ]
73
- );
70
+ if (!empty ($ courseInfo )) {
71
+ CourseManager::autoSubscribeToCourse ($ courseCodeToSubscribe );
72
+ $ redirectionTarget = CoursesAndSessionsCatalog::generateRedirectUrlAfterSubscription (
73
+ $ courseInfo ['course_public_url ' ]
74
+ );
74
75
75
- header ("Location: $ redirectionTarget " );
76
- exit ;
76
+ header ("Location: $ redirectionTarget " );
77
+ exit ;
78
+ }
77
79
}
80
+ Display::addFlash (
81
+ Display::return_message (get_lang ('NoResults ' ), 'warning ' )
82
+ );
83
+ CoursesAndSessionsCatalog::displayCoursesList ('search_course ' , $ searchTerm , $ categoryCode );
84
+
85
+ exit ;
86
+
78
87
break ;
79
88
case 'subscribe_course_validation ' :
80
89
$ toolTitle = get_lang ('Subscribe ' );
You can’t perform that action at this time.
0 commit comments