Code Duplication    Length = 13-15 lines in 3 locations

typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php 2 locations

@@ 733-745 (lines=13) @@
730
                    // Keep mount point?
731
                    $mount_info = $this->sys_page->getMountPointInfo($row['uid'], $row);
732
                    // There is a valid mount point.
733
                    if (is_array($mount_info) && $mount_info['overlay']) {
734
                        // Using "getPage" is OK since we need the check for enableFields
735
                        // AND for type 2 of mount pids we DO require a doktype < 200!
736
                        $mp_row = $this->sys_page->getPage($mount_info['mount_pid']);
737
                        if (!empty($mp_row)) {
738
                            $row = $mp_row;
739
                            $row['_MP_PARAM'] = $mount_info['MPvar'];
740
                        } else {
741
                            // If the mount point could not be fetched with respect
742
                            // to enableFields, unset the row so it does not become a part of the menu!
743
                            unset($row);
744
                        }
745
                    }
746
                    // Add external MP params, then the row:
747
                    if (!empty($row)) {
748
                        if ($MP) {
@@ 791-805 (lines=15) @@
788
                // Using "getPage" is OK since we need the check for enableFields
789
                // AND for type 2 of mount pids we DO require a doktype < 200!
790
                $mp_row = $this->sys_page->getPage($mount_info['mount_pid']);
791
                if (!empty($mp_row)) {
792
                    $row = $mp_row;
793
                    $row['_MP_PARAM'] = $mount_info['MPvar'];
794
                    // Overlays should already have their full MPvars calculated
795
                    if ($mount_info['overlay']) {
796
                        $MP = $this->tmpl->getFromMPmap($mount_info['mount_pid']);
797
                        if ($MP) {
798
                            unset($row['_MP_PARAM']);
799
                        }
800
                    }
801
                } else {
802
                    // If the mount point could not be fetched with respect to
803
                    // enableFields, unset the row so it does not become a part of the menu!
804
                    unset($row);
805
                }
806
            } else {
807
                $row = $loadDB->results['pages'][$val['id']];
808
            }

typo3/sysext/frontend/Classes/Page/PageRepository.php 1 location

@@ 781-793 (lines=13) @@
778
        $mountPointInfo = $this->getMountPointInfo($page['uid'], $page);
779
780
        // There is a valid mount point in overlay mode.
781
        if (is_array($mountPointInfo) && $mountPointInfo['overlay']) {
782
783
            // Using "getPage" is OK since we need the check for enableFields AND for type 2
784
            // of mount pids we DO require a doktype < 200!
785
            $mountPointPage = $this->getPage($mountPointInfo['mount_pid']);
786
787
            if (!empty($mountPointPage)) {
788
                $page = $mountPointPage;
789
                $page['_MP_PARAM'] = $mountPointInfo['MPvar'];
790
            } else {
791
                $page = [];
792
            }
793
        }
794
        return $page;
795
    }
796