Code Duplication    Length = 13-13 lines in 2 locations

main/forum/index.php 1 location

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

main/lp/learnpath.class.php 1 location

@@ 9577-9589 (lines=13) @@
9574
9575
        $forumCategories = get_forum_categories();
9576
        $forumsInNoCategory = get_forums_in_category(0);
9577
        if (!empty($forumsInNoCategory)) {
9578
            $forumCategories = array_merge(
9579
                $forumCategories,
9580
                array(
9581
                    array(
9582
                        'cat_id' => 0,
9583
                        'session_id' => 0,
9584
                        'visibility' => 1,
9585
                        'cat_comment' => null,
9586
                    ),
9587
                )
9588
            );
9589
        }
9590
9591
        $forumList = get_forums();
9592
        $a_forums = [];