Skip to content

Commit 9605de6

Browse files
committed
More validations to avoid "Notices"
1 parent b79a75a commit 9605de6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

main/forum/forumfunction.inc.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -702,17 +702,17 @@ function store_forum($values, $courseInfo = array(), $returnId = false)
702702
$params = [
703703
'forum_title'=> $values['forum_title'],
704704
'forum_image'=> $sql_image,
705-
'forum_comment'=> $values['forum_comment'],
706-
'forum_category'=> $values['forum_category'],
705+
'forum_comment'=> isset($values['forum_comment']) ? $values['forum_comment'] : null,
706+
'forum_category'=> isset($values['forum_category']) ? $values['forum_category'] : null,
707707
'allow_anonymous'=> isset($values['allow_anonymous_group']['allow_anonymous']) ? $values['allow_anonymous_group']['allow_anonymous'] : null,
708-
'allow_edit'=> $values['students_can_edit_group']['students_can_edit'],
708+
'allow_edit'=> isset($values['students_can_edit_group']['students_can_edit']) ? $values['students_can_edit_group']['students_can_edit'] : null,
709709
'approval_direct_post'=> isset($values['approval_direct_group']['approval_direct']) ? $values['approval_direct_group']['approval_direct'] : null,
710710
'allow_attachments'=> isset($values['allow_attachments_group']['allow_attachments']) ? $values['allow_attachments_group']['allow_attachments'] : null,
711-
'allow_new_threads'=> $values['allow_new_threads_group']['allow_new_threads'],
712-
'default_view'=> $values['default_view_type_group']['default_view_type'],
713-
'forum_of_group'=> $values['group_forum'],
714-
'forum_group_public_private'=> $values['public_private_group_forum_group']['public_private_group_forum'],
715-
'forum_order'=> $new_max,
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,
716716
'session_id'=> $session_id,
717717
];
718718

0 commit comments

Comments
 (0)