From ffe437953395d504ce93632096ba87c58eaf5954 Mon Sep 17 00:00:00 2001
From: Benni Mack <benni@typo3.org>
Date: Thu, 27 Apr 2017 10:53:47 +0200
Subject: [PATCH] [!!!][TASK] Remove cObj->getClosestMPvalueForPage()

An internal method that is related to the TypoLinkBuilder extraction
and previously used within cObj->typolink() is removed as part
of the deprecation removal cleanup.

Resolves: #81038
Releases: master
Change-Id: I1da0f2bf1941bf82aa49725146d4ee173b2cf6cd
Reviewed-on: https://review.typo3.org/52630
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
---
 ...g-80700-DeprecatedFunctionalityRemoved.rst |  1 +
 .../ContentObject/ContentObjectRenderer.php   | 57 -------------------
 2 files changed, 1 insertion(+), 57 deletions(-)

diff --git a/typo3/sysext/core/Documentation/Changelog/master/Breaking-80700-DeprecatedFunctionalityRemoved.rst b/typo3/sysext/core/Documentation/Changelog/master/Breaking-80700-DeprecatedFunctionalityRemoved.rst
index 93467698cb2c..06ff9cf35132 100644
--- a/typo3/sysext/core/Documentation/Changelog/master/Breaking-80700-DeprecatedFunctionalityRemoved.rst
+++ b/typo3/sysext/core/Documentation/Changelog/master/Breaking-80700-DeprecatedFunctionalityRemoved.rst
@@ -171,6 +171,7 @@ The following PHP class methods that have been previously deprecated for v8 have
 * TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->clearTSProperties()
 * TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->fileResource()
 * TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->fillInMarkerArray()
+* TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->getClosestMPvalueForPage()
 * TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->getSubpart()
 * TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->getWhere()
 * TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->gifBuilderTextBox()
diff --git a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
index 8ef73dad0681..225ee7b41cd1 100644
--- a/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
+++ b/typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
@@ -5595,63 +5595,6 @@ class ContentObjectRenderer
         return $url;
     }
 
-    /**
-     * Returns the &MP variable value for a page id.
-     * The function will do its best to find a MP value that will keep the page id inside the current Mount Point rootline if any.
-     *
-     * @param int $pageId page id
-     * @param bool $raw If TRUE, the MPvalue is returned raw. Normally it is encoded as &MP=... variable
-     * @return string MP value, prefixed with &MP= (depending on $raw)
-     * @see typolink()
-     */
-    public function getClosestMPvalueForPage($pageId, $raw = false)
-    {
-        $tsfe = $this->getTypoScriptFrontendController();
-        if (empty($GLOBALS['TYPO3_CONF_VARS']['FE']['enable_mount_pids']) || !$tsfe->MP) {
-            return '';
-        }
-        // MountPoints:
-        $MP = '';
-        // Same page as current.
-        if ((int)$tsfe->id === (int)$pageId) {
-            $MP = $tsfe->MP;
-        } else {
-            // ... otherwise find closest meeting point:
-            // Gets rootline of linked-to page
-            $tCR_rootline = $tsfe->sys_page->getRootLine($pageId, '', true);
-            $inverseTmplRootline = array_reverse($tsfe->tmpl->rootLine);
-            $rl_mpArray = [];
-            $startMPaccu = false;
-            // Traverse root line of link uid and inside of that the REAL root line of current position.
-            foreach ($tCR_rootline as $tCR_data) {
-                foreach ($inverseTmplRootline as $rlKey => $invTmplRLRec) {
-                    // Force accumulating when in overlay mode: Links to this page have to stay within the current branch
-                    if ($invTmplRLRec['_MOUNT_OL'] && (int)$tCR_data['uid'] === (int)$invTmplRLRec['uid']) {
-                        $startMPaccu = true;
-                    }
-                    // Accumulate MP data:
-                    if ($startMPaccu && $invTmplRLRec['_MP_PARAM']) {
-                        $rl_mpArray[] = $invTmplRLRec['_MP_PARAM'];
-                    }
-                    // If two PIDs matches and this is NOT the site root, start accumulation of MP data (on the next level):
-                    // (The check for site root is done so links to branches outsite the site but sharing the site roots PID
-                    // is NOT detected as within the branch!)
-                    if ((int)$tCR_data['pid'] === (int)$invTmplRLRec['pid'] && count($inverseTmplRootline) !== $rlKey + 1) {
-                        $startMPaccu = true;
-                    }
-                }
-                if ($startMPaccu) {
-                    // Good enough...
-                    break;
-                }
-            }
-            if (!empty($rl_mpArray)) {
-                $MP = implode(',', array_reverse($rl_mpArray));
-            }
-        }
-        return $raw ? $MP : ($MP ? '&MP=' . rawurlencode($MP) : '');
-    }
-
     /**
      * Creates a href attibute for given $mailAddress.
      * The function uses spamProtectEmailAddresses for encoding the mailto statement.
-- 
GitLab