Code Duplication    Length = 13-13 lines in 2 locations

main/forum/index.php 1 location

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

main/newscorm/learnpath.class.php 1 location

@@ 8911-8923 (lines=13) @@
8908
8909
        $forumCategories = get_forum_categories();
8910
        $forumsInNoCategory = get_forums_in_category(0);
8911
        if (!empty($forumsInNoCategory)) {
8912
            $forumCategories = array_merge(
8913
                $forumCategories,
8914
                array(
8915
                    array(
8916
                        'cat_id' => 0,
8917
                        'session_id' => 0,
8918
                        'visibility' => 1,
8919
                        'cat_comment' => null,
8920
                    ),
8921
                )
8922
            );
8923
        }
8924
8925
        $forumList = get_forums();
8926
        $a_forums = [];