Gradebook: Fix fatal error, gradebook must have a course.

pull/3924/head
Julio Montoya 4 years ago
parent f13f29604c
commit 771bec5fbb
  1. 11
      public/main/gradebook/gradebook_edit_all.php
  2. 3
      public/main/gradebook/gradebook_edit_link.php

@ -30,7 +30,9 @@ $logInfo = [
]; ];
Event::registerLog($logInfo); Event::registerLog($logInfo);
$course_id = GradebookUtils::get_course_id_by_link_id($my_selectcat); //$course_id = GradebookUtils::get_course_id_by_link_id($my_selectcat);
$course_id = api_get_course_int_id();
$table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); $table_link = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
$table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION); $table_evaluation = Database::get_main_table(TABLE_MAIN_GRADEBOOK_EVALUATION);
$tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD); $tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD);
@ -191,7 +193,12 @@ $currentUrl = api_get_self().'?'.api_get_cidreq().'&selectcat='.$my_selectcat;
$form = new FormValidator('auto_weight', 'post', $currentUrl); $form = new FormValidator('auto_weight', 'post', $currentUrl);
$form->addHeader(get_lang('Automatic weight')); $form->addHeader(get_lang('Automatic weight'));
$form->addLabel(null, get_lang('Automatic weightExplanation')); $form->addLabel(
null,
get_lang(
'Use the automatic weight distribution to speed things up. The system will then distribute the total weight evenly between the evaluation items below.'
)
);
$form->addButtonUpdate(get_lang('Automatic weight')); $form->addButtonUpdate(get_lang('Automatic weight'));
if ($form->validate()) { if ($form->validate()) {

@ -8,7 +8,8 @@ api_block_anonymous_users();
GradebookUtils::block_students(); GradebookUtils::block_students();
$tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK); $tbl_grade_links = Database::get_main_table(TABLE_MAIN_GRADEBOOK_LINK);
//selected name of database //selected name of database
$course_id = GradebookUtils::get_course_id_by_link_id($_GET['editlink']); //$course_id = GradebookUtils::get_course_id_by_link_id($_GET['editlink']);
$course_id = api_get_course_int_id();
$tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD); $tbl_forum_thread = Database::get_course_table(TABLE_FORUM_THREAD);
$tbl_attendance = Database::get_course_table(TABLE_ATTENDANCE); $tbl_attendance = Database::get_course_table(TABLE_ATTENDANCE);
$em = Database::getManager(); $em = Database::getManager();

Loading…
Cancel
Save