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 6767 }
6868 if (Security::check_token ('get ' )) {
6969 $ 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+ );
7475
75- header ("Location: $ redirectionTarget " );
76- exit ;
76+ header ("Location: $ redirectionTarget " );
77+ exit ;
78+ }
7779 }
80+ Display::addFlash (
81+ Display::return_message (get_lang ('NoResults ' ), 'warning ' )
82+ );
83+ CoursesAndSessionsCatalog::displayCoursesList ('search_course ' , $ searchTerm , $ categoryCode );
84+
85+ exit ;
86+
7887 break ;
7988 case 'subscribe_course_validation ' :
8089 $ toolTitle = get_lang ('Subscribe ' );
You can’t perform that action at this time.
0 commit comments