Code Duplication    Length = 13-13 lines in 2 locations

main/forum/index.php 1 location

@@ 220-232 (lines=13) @@
217
218
// Fixes error if there forums with no category.
219
$forumsInNoCategory = get_forums_in_category(0);
220
if (!empty($forumsInNoCategory)) {
221
    $forumCategories = array_merge(
222
        $forumCategories,
223
        array(
224
            array(
225
                'cat_id' => 0,
226
                'session_id' => 0,
227
                'visibility' => 1,
228
                'cat_comment' => null
229
            )
230
        )
231
    );
232
}
233
234
/* Display Forum Categories and the Forums in it */
235
// Step 3: We display the forum_categories first.

main/lp/learnpath.class.php 1 location

@@ 9525-9537 (lines=13) @@
9522
9523
        $forumCategories = get_forum_categories();
9524
        $forumsInNoCategory = get_forums_in_category(0);
9525
        if (!empty($forumsInNoCategory)) {
9526
            $forumCategories = array_merge(
9527
                $forumCategories,
9528
                array(
9529
                    array(
9530
                        'cat_id' => 0,
9531
                        'session_id' => 0,
9532
                        'visibility' => 1,
9533
                        'cat_comment' => null,
9534
                    ),
9535
                )
9536
            );
9537
        }
9538
9539
        $forumList = get_forums();
9540
        $a_forums = [];