Skip to content

Commit c3a618a

Browse files
committed
Merge pull request #891 from jloguercio/forums
Fix some notice and bug in forums
2 parents bfe45dd + 9605de6 commit c3a618a

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

main/forum/forumfunction.inc.php

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -542,6 +542,7 @@ function store_forumcategory($values, $courseInfo = array(), $showMessage = true
542542
$new_max = $row['sort_max'] + 1;
543543
$session_id = api_get_session_id();
544544
$clean_cat_title = $values['forum_category_title'];
545+
$last_id = null;
545546

546547
if (isset($values['forum_category_id'])) {
547548
// Storing after edition.
@@ -701,17 +702,17 @@ function store_forum($values, $courseInfo = array(), $returnId = false)
701702
$params = [
702703
'forum_title'=> $values['forum_title'],
703704
'forum_image'=> $sql_image,
704-
'forum_comment'=> $values['forum_comment'],
705-
'forum_category'=> $values['forum_category'],
706-
'allow_anonymous'=> $values['allow_anonymous_group']['allow_anonymous'],
707-
'allow_edit'=> $values['students_can_edit_group']['students_can_edit'],
708-
'approval_direct_post'=> $values['approval_direct_group']['approval_direct'],
709-
'allow_attachments'=> $values['allow_attachments_group']['allow_attachments'],
710-
'allow_new_threads'=> $values['allow_new_threads_group']['allow_new_threads'],
711-
'default_view'=> $values['default_view_type_group']['default_view_type'],
712-
'forum_of_group'=> $values['group_forum'],
713-
'forum_group_public_private'=> $values['public_private_group_forum_group']['public_private_group_forum'],
714-
'forum_order'=> $new_max,
705+
'forum_comment'=> isset($values['forum_comment']) ? $values['forum_comment'] : null,
706+
'forum_category'=> isset($values['forum_category']) ? $values['forum_category'] : null,
707+
'allow_anonymous'=> isset($values['allow_anonymous_group']['allow_anonymous']) ? $values['allow_anonymous_group']['allow_anonymous'] : null,
708+
'allow_edit'=> isset($values['students_can_edit_group']['students_can_edit']) ? $values['students_can_edit_group']['students_can_edit'] : null,
709+
'approval_direct_post'=> isset($values['approval_direct_group']['approval_direct']) ? $values['approval_direct_group']['approval_direct'] : null,
710+
'allow_attachments'=> isset($values['allow_attachments_group']['allow_attachments']) ? $values['allow_attachments_group']['allow_attachments'] : null,
711+
'allow_new_threads'=> isset($values['allow_new_threads_group']['allow_new_threads']) ? $values['allow_new_threads_group']['allow_new_threads'] : null,
712+
'default_view'=> isset($values['default_view_type_group']['default_view_type']) ? $values['default_view_type_group']['default_view_type'] : null,
713+
'forum_of_group'=> isset($values['group_forum']) ? $values['group_forum'] : null,
714+
'forum_group_public_private'=> isset($values['public_private_group_forum_group']['public_private_group_forum']) ? $values['public_private_group_forum_group']['public_private_group_forum'] : null,
715+
'forum_order'=> isset($new_max) ? $new_max : null,
715716
'session_id'=> $session_id,
716717
];
717718

0 commit comments

Comments
 (0)