[!!!][TASK] Remove deprecated cObj/stdWrap functionality 18/59218/3
authorBenni Mack <benni@typo3.org>
Wed, 19 Dec 2018 16:07:40 +0000 (17:07 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Wed, 19 Dec 2018 16:43:00 +0000 (17:43 +0100)
The following methods within cObj have been removed:
- enableFields()
- currentPageUrl()
- typolinkWrap()
- calcIntExplode()
- filelink()
- addParams()
- filelist()
- stdWrap_filelink()
- stdWrap_addParams()
- stdWrap_filelist()

The following TypoScript stdWrap properties are now removed:
- filelist
- filelink
- addParams

Resolves: #87221
Releases: master
Change-Id: I08ca55b0ac51412356fd40f34193f6b3869c3071
Reviewed-on: https://review.typo3.org/59218
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
typo3/sysext/core/Documentation/Changelog/master/Breaking-87193-DeprecatedFunctionalityRemoved.rst
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Tests/Unit/ContentObject/ContentObjectRendererTest.php
typo3/sysext/frontend/Tests/UnitDeprecated/ContentObject/ContentObjectRendererTest.php [deleted file]
typo3/sysext/install/Configuration/ExtensionScanner/Php/MethodCallMatcher.php

index 5f90860..a4548d1 100644 (file)
@@ -145,6 +145,16 @@ The following PHP class methods that have been previously deprecated for v9 have
 * :php:`TYPO3\CMS\Core\TypoScript\TemplateService->initMPmap_create()`
 * :php:`TYPO3\CMS\Core\TypoScript\TemplateService->linkData()`
 * :php:`TYPO3\CMS\Core\TypoScript\TemplateService->printTitle()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->addParams()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->calcIntExplode()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->currentPageUrl()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->enableFields()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->filelink()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->filelist()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->typolinkWrap()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->stdWrap_addParams()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->stdWrap_filelink()`
+* :php:`TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->stdWrap_filelist()`
 * :php:`TYPO3\CMS\Frontend\Page\PageRepository->getFirstWebPage()`
 * :php:`TYPO3\CMS\Frontend\Page\PageRepository->getDomainStartPage()`
 * :php:`TYPO3\CMS\Frontend\Page\PageRepository->getRootLine()`
@@ -253,6 +263,13 @@ The following user TSconfig options have been dropped:
 * Prefix `mod.` to override page TSconfig is ignored
 
 
+The following TypoScript options have been dropped:
+
+* `stdWrap.addParams`
+* `stdWrap.filelink`
+* `stdWrap.filelist`
+
+
 The following constants have been dropped:
 
 * :php:`TYPO3\CMS\Core\Crypto\PasswordHashing\BlowfishPasswordHash::ITOA64`
index 96029d5..987f434 100644 (file)
@@ -43,7 +43,6 @@ use TYPO3\CMS\Core\Resource\FileReference;
 use TYPO3\CMS\Core\Resource\Folder;
 use TYPO3\CMS\Core\Resource\ProcessedFile;
 use TYPO3\CMS\Core\Resource\ResourceFactory;
-use TYPO3\CMS\Core\Resource\StorageRepository;
 use TYPO3\CMS\Core\Service\DependencyOrderingService;
 use TYPO3\CMS\Core\Service\FlexFormService;
 use TYPO3\CMS\Core\Service\MarkerBasedTemplateService;
@@ -58,7 +57,6 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Core\Utility\HttpUtility;
 use TYPO3\CMS\Core\Utility\MailUtility;
 use TYPO3\CMS\Core\Utility\MathUtility;
-use TYPO3\CMS\Core\Utility\PathUtility;
 use TYPO3\CMS\Core\Utility\StringUtility;
 use TYPO3\CMS\Core\Versioning\VersionState;
 use TYPO3\CMS\Frontend\ContentObject\Exception\ContentRenderingException;
@@ -121,10 +119,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
         'cObject' => 'cObject',
         'cObject.' => 'array',
         'numRows.' => 'array',
-        // @deprecated - will be removed in TYPO3 v10.0.
-        'filelist' => 'dir',
-        // @deprecated - will be removed in TYPO3 v10.0.
-        'filelist.' => 'array',
         'preUserFunc' => 'functionName',
         'stdWrapOverride' => 'hook',
         // this is a placeholder for the second Hook
@@ -212,10 +206,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
         'innerWrap.' => 'array',
         'innerWrap2' => 'wrap',
         'innerWrap2.' => 'array',
-        // @deprecated - will be removed in TYPO3 v10.0.
-        'addParams.' => 'array',
-        // @deprecated - will be removed in TYPO3 v10.0.
-        'filelink.' => 'array',
         'preCObject' => 'cObject',
         'preCObject.' => 'array',
         'postCObject' => 'cObject',
@@ -1835,20 +1825,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
     }
 
     /**
-     * filelist
-     * Will create a list of files based on some additional parameters
-     *
-     * @param string $content Input value undergoing processing in this function.
-     * @param array $conf stdWrap properties for filelist.
-     * @return string The processed input value
-     * @deprecated since TYPO3 v9.5, will be removed in TYPO3 v10.0. Use cObject FILES instead.
-     */
-    public function stdWrap_filelist($content = '', $conf = [])
-    {
-        return $this->filelist($conf['filelist'], true);
-    }
-
-    /**
      * preUserFunc
      * Will execute a user public function before the content will be modified by any other stdWrap function
      *
@@ -2568,35 +2544,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
     }
 
     /**
-     * addParams
-     * Adds tag attributes to any content that is a tag
-     *
-     * @param string $content Input value undergoing processing in this function.
-     * @param array $conf stdWrap properties for addParams.
-     * @return string The processed input value
-     * @deprecated since TYPO3 v9.5, will be removed in TYPO3 v10.0.
-     */
-    public function stdWrap_addParams($content = '', $conf = [])
-    {
-        return $this->addParams($content, $conf['addParams.'] ?? [], true);
-    }
-
-    /**
-     * filelink
-     * Used to make lists of links to files
-     * See wrap
-     *
-     * @param string $content Input value undergoing processing in this function.
-     * @param array $conf stdWrap properties for filelink.
-     * @return string The processed input value
-     * @deprecated since TYPO3 v9.5, will be removed in TYPO3 v10.0. Use cObject FILES instead.
-     */
-    public function stdWrap_filelink($content = '', $conf = [])
-    {
-        return $this->filelink($content, $conf['filelink.'] ?? [], true);
-    }
-
-    /**
      * preCObject
      * A content object that is prepended to the current content but between the innerWraps and the rest of the wraps
      *
@@ -3120,115 +3067,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
     }
 
     /**
-     * Reads a directory for files and returns the filepaths in a string list separated by comma.
-     * Implements the stdWrap property "filelist"
-     *
-     * @param string $data The command which contains information about what files/directory listing to return. See the "filelist" property of stdWrap for details.
-     * @param bool $isCoreCall if set, the deprecation message is suppressed
-     * @return string Comma list of files.
-     * @internal
-     * @see stdWrap()
-     * @deprecated since TYPO3 v9.5, will be removed in TYPO3 v10.0. Use cObject FILES instead.
-     */
-    public function filelist($data, bool $isCoreCall = false)
-    {
-        if (!$isCoreCall) {
-            trigger_error('ContentObjectRenderer->filelist() will be removed in TYPO3 v10.0. Use cObject FILES instead.', E_USER_DEPRECATED);
-        }
-        $data = trim($data);
-        if ($data === '') {
-            return '';
-        }
-        list($possiblePath, $ext_list, $sorting, $reverse, $useFullPath) = GeneralUtility::trimExplode('|', $data);
-        // read directory:
-        // MUST exist!
-        $path = '';
-        // proceeds if no '//', '..' or '\' is in the $theFile
-        if (GeneralUtility::validPathStr($possiblePath)) {
-            // Removes all dots, slashes and spaces after a path.
-            $possiblePath = preg_replace('/[\\/\\. ]*$/', '', $possiblePath);
-            if (!GeneralUtility::isAbsPath($possiblePath) && @is_dir($possiblePath)) {
-                // Now check if it matches one of the FAL storages
-                $storageRepository = GeneralUtility::makeInstance(StorageRepository::class);
-                $storages = $storageRepository->findAll();
-                foreach ($storages as $storage) {
-                    if ($storage->getDriverType() === 'Local' && $storage->isPublic() && $storage->isOnline()) {
-                        $folder = $storage->getPublicUrl($storage->getRootLevelFolder(), true);
-                        if (GeneralUtility::isFirstPartOfStr($possiblePath . '/', $folder)) {
-                            $path = $possiblePath;
-                            break;
-                        }
-                    }
-                }
-            }
-        }
-        if (!$path) {
-            return '';
-        }
-        $items = [
-            'files' => [],
-            'sorting' => []
-        ];
-        $ext_list = strtolower(GeneralUtility::uniqueList($ext_list));
-        // Read dir:
-        $d = @dir($path);
-        if (is_object($d)) {
-            $count = 0;
-            while ($entry = $d->read()) {
-                if ($entry !== '.' && $entry !== '..') {
-                    // Because of odd PHP-error where <br />-tag is sometimes placed after a filename!!
-                    $wholePath = $path . '/' . $entry;
-                    if (file_exists($wholePath) && filetype($wholePath) === 'file') {
-                        $info = GeneralUtility::split_fileref($wholePath);
-                        if (!$ext_list || GeneralUtility::inList($ext_list, $info['fileext'])) {
-                            $items['files'][] = $info['file'];
-                            switch ($sorting) {
-                                case 'name':
-                                    $items['sorting'][] = strtolower($info['file']);
-                                    break;
-                                case 'size':
-                                    $items['sorting'][] = filesize($wholePath);
-                                    break;
-                                case 'ext':
-                                    $items['sorting'][] = $info['fileext'];
-                                    break;
-                                case 'date':
-                                    $items['sorting'][] = filectime($wholePath);
-                                    break;
-                                case 'mdate':
-                                    $items['sorting'][] = filemtime($wholePath);
-                                    break;
-                                default:
-                                    $items['sorting'][] = $count;
-                            }
-                            $count++;
-                        }
-                    }
-                }
-            }
-            $d->close();
-        }
-        // Sort if required
-        if (!empty($items['sorting'])) {
-            if (strtolower($reverse) !== 'r') {
-                asort($items['sorting']);
-            } else {
-                arsort($items['sorting']);
-            }
-        }
-        if (!empty($items['files'])) {
-            // Make list
-            reset($items['sorting']);
-            $list_arr = [];
-            foreach ($items['sorting'] as $key => $v) {
-                $list_arr[] = $useFullPath ? $path . '/' . $items['files'][$key] : $items['files'][$key];
-            }
-            return implode(',', $list_arr);
-        }
-        return '';
-    }
-
-    /**
      * Passes the input value, $theValue, to an instance of "\TYPO3\CMS\Core\Html\HtmlParser"
      * together with the TypoScript options which are first converted from a TS style array
      * to a set of arrays with options for the \TYPO3\CMS\Core\Html\HtmlParser class.
@@ -3524,226 +3362,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
     }
 
     /**
-     * Implements the TypoScript function "addParams"
-     *
-     * @param string $content The string with the HTML tag.
-     * @param array $conf The TypoScript configuration properties
-     * @param bool $isCoreCall if set, the deprecation message is suppressed
-     * @return string The modified string
-     * @todo Make it XHTML compatible. Will not present "/>" endings of tags right now. Further getting the tagname might fail if it is not separated by a normal space from the attributes.
-     * @deprecated since TYPO3 v9.5, will be removed in TYPO3 v10.0.
-     */
-    public function addParams($content, $conf, $isCoreCall = false)
-    {
-        if (!$isCoreCall) {
-            trigger_error('ContentObjectRenderer->addParams() will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
-        }
-        // For XHTML compliance.
-        $lowerCaseAttributes = true;
-        if (!is_array($conf)) {
-            return $content;
-        }
-        $key = 1;
-        $parts = explode('<', $content);
-        if (isset($conf['_offset']) && (int)$conf['_offset']) {
-            $key = (int)$conf['_offset'] < 0 ? count($parts) + (int)$conf['_offset'] : (int)$conf['_offset'];
-        }
-        $subparts = explode('>', $parts[$key] ?? '');
-        if (trim($subparts[0])) {
-            // Get attributes and name
-            $attribs = GeneralUtility::get_tag_attributes('<' . $subparts[0] . '>');
-            list($tagName) = explode(' ', $subparts[0], 2);
-            // adds/overrides attributes
-            foreach ($conf as $pkey => $val) {
-                if (substr($pkey, -1) !== '.' && $pkey[0] !== '_') {
-                    $tmpVal = isset($conf[$pkey . '.']) ? $this->stdWrap($conf[$pkey], $conf[$pkey . '.']) : (string)$val;
-                    if ($lowerCaseAttributes) {
-                        $pkey = strtolower($pkey);
-                    }
-                    if ($tmpVal !== '') {
-                        $attribs[$pkey] = $tmpVal;
-                    }
-                }
-            }
-            // Re-assembles the tag and content
-            $subparts[0] = trim($tagName . ' ' . GeneralUtility::implodeAttributes($attribs));
-            $parts[$key] = implode('>', $subparts);
-            $content = implode('<', $parts);
-        }
-        return $content;
-    }
-
-    /**
-     * Creates a list of links to files.
-     * Implements the stdWrap property "filelink"
-     *
-     * @param string $theValue The filename to link to, possibly prefixed with $conf[path]
-     * @param array $conf TypoScript parameters for the TypoScript function ->filelink
-     * @param bool $isCoreCall if set, the deprecation message is suppressed
-     * @return string The link to the file possibly with icons, thumbnails, size in bytes shown etc.
-     * @internal
-     * @see stdWrap()
-     * @deprecated since TYPO3 v9.5, will be removed in TYPO3 v10.0. Use cObject FILES instead.
-     */
-    public function filelink($theValue, $conf, $isCoreCall = false)
-    {
-        if (!$isCoreCall) {
-            trigger_error('ContentObjectRenderer->filelink() will be removed in TYPO3 v10.0. Use cObject FILES instead.', E_USER_DEPRECATED);
-        }
-        $conf['path'] = isset($conf['path.'])
-            ? $this->stdWrap($conf['path'] ?? '', $conf['path.'])
-            : ($conf['path'] ?? '');
-        $theFile = trim($conf['path']) . $theValue;
-        if (!@is_file($theFile)) {
-            return '';
-        }
-        $theFileEnc = str_replace('%2F', '/', rawurlencode($theFile));
-        $title = $conf['title'] ?? '';
-        if (isset($conf['title.'])) {
-            $title = $this->stdWrap($title, $conf['title.']);
-        }
-        $target = $conf['target'] ?? '';
-        if (isset($conf['target.'])) {
-            $target = $this->stdWrap($target, $conf['target.']);
-        }
-        $tsfe = $this->getTypoScriptFrontendController();
-
-        $typoLinkConf = [
-            'parameter' => $theFileEnc,
-            'fileTarget' => $target,
-            'title' => $title,
-            'ATagParams' => $this->getATagParams($conf)
-        ];
-
-        if (isset($conf['typolinkConfiguration.'])) {
-            $additionalTypoLinkConfiguration = $conf['typolinkConfiguration.'];
-            // We only allow additional configuration. This is why the generated conf overwrites the additional conf.
-            ArrayUtility::mergeRecursiveWithOverrule($additionalTypoLinkConfiguration, $typoLinkConf);
-            $typoLinkConf = $additionalTypoLinkConfiguration;
-        }
-
-        $theLinkWrap = $this->typoLink('|', $typoLinkConf);
-        $theSize = filesize($theFile);
-        $fI = GeneralUtility::split_fileref($theFile);
-        $icon = '';
-        if ($conf['icon'] ?? false) {
-            $conf['icon.']['path'] = isset($conf['icon.']['path.'])
-                ? $this->stdWrap($conf['icon.']['path'], $conf['icon.']['path.'])
-                : $conf['icon.']['path'];
-            $iconPath = !empty($conf['icon.']['path'])
-                ? $conf['icon.']['path']
-                : GeneralUtility::getFileAbsFileName('EXT:frontend/Resources/Public/Icons/FileIcons/');
-            $conf['icon.']['ext'] = isset($conf['icon.']['ext.'])
-                ? $this->stdWrap($conf['icon.']['ext'], $conf['icon.']['ext.'])
-                : $conf['icon.']['ext'];
-            $iconExt = !empty($conf['icon.']['ext']) ? '.' . $conf['icon.']['ext'] : '.gif';
-            $icon = @is_file($iconPath . $fI['fileext'] . $iconExt)
-                ? $iconPath . $fI['fileext'] . $iconExt
-                : $iconPath . 'default' . $iconExt;
-            $icon = PathUtility::stripPathSitePrefix($icon);
-            // Checking for images: If image, then return link to thumbnail.
-            $IEList = isset($conf['icon_image_ext_list.']) ? $this->stdWrap($conf['icon_image_ext_list'], $conf['icon_image_ext_list.']) : $conf['icon_image_ext_list'];
-            $image_ext_list = str_replace(' ', '', strtolower($IEList));
-            if ($fI['fileext'] && GeneralUtility::inList($image_ext_list, $fI['fileext'])) {
-                if ($conf['iconCObject']) {
-                    $icon = $this->cObjGetSingle($conf['iconCObject'], $conf['iconCObject.'], 'iconCObject');
-                } else {
-                    $notFoundThumb = GeneralUtility::getFileAbsFileName('EXT:core/Resources/Public/Images/NotFound.gif');
-                    $notFoundThumb = PathUtility::stripPathSitePrefix($notFoundThumb);
-                    $sizeParts = [64, 64];
-                    if ($GLOBALS['TYPO3_CONF_VARS']['GFX']['thumbnails']) {
-                        // using the File Abstraction Layer to generate a preview image
-                        try {
-                            /** @var File $fileObject */
-                            $fileObject = ResourceFactory::getInstance()->retrieveFileOrFolderObject($theFile);
-                            if ($fileObject->isMissing()) {
-                                $icon = $notFoundThumb;
-                            } else {
-                                $fileExtension = $fileObject->getExtension();
-                                if ($fileExtension === 'ttf' || GeneralUtility::inList($GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'], $fileExtension)) {
-                                    if ($conf['icon_thumbSize'] || $conf['icon_thumbSize.']) {
-                                        $thumbSize = isset($conf['icon_thumbSize.']) ? $this->stdWrap($conf['icon_thumbSize'], $conf['icon_thumbSize.']) : $conf['icon_thumbSize'];
-                                        $sizeParts = explode('x', $thumbSize);
-                                    }
-                                    $icon = $fileObject->process(ProcessedFile::CONTEXT_IMAGEPREVIEW, [
-                                        'width' => $sizeParts[0],
-                                        'height' => $sizeParts[1]
-                                    ])->getPublicUrl(true);
-                                }
-                            }
-                        } catch (ResourceDoesNotExistException $exception) {
-                            $icon = $notFoundThumb;
-                        }
-                    } else {
-                        $icon = $notFoundThumb;
-                    }
-                    $urlPrefix = '';
-                    if (parse_url($icon, PHP_URL_HOST) === null) {
-                        $urlPrefix = $tsfe->absRefPrefix;
-                    }
-                    $icon = '<img src="' . htmlspecialchars($urlPrefix . $icon) . '"' .
-                        ' width="' . (int)$sizeParts[0] . '" height="' . (int)$sizeParts[1] . '" ' .
-                        $this->getBorderAttr(' border="0"') . '' . $this->getAltParam($conf) . ' />';
-                }
-            } else {
-                $conf['icon.']['widthAttribute'] = isset($conf['icon.']['widthAttribute.'])
-                    ? $this->stdWrap($conf['icon.']['widthAttribute'], $conf['icon.']['widthAttribute.'])
-                    : $conf['icon.']['widthAttribute'];
-                $iconWidth = !empty($conf['icon.']['widthAttribute']) ? $conf['icon.']['widthAttribute'] : 18;
-                $conf['icon.']['heightAttribute'] = isset($conf['icon.']['heightAttribute.'])
-                    ? $this->stdWrap($conf['icon.']['heightAttribute'], $conf['icon.']['heightAttribute.'])
-                    : $conf['icon.']['heightAttribute'];
-                $iconHeight = !empty($conf['icon.']['heightAttribute']) ? (int)$conf['icon.']['heightAttribute'] : 16;
-                $icon = '<img src="' . htmlspecialchars($tsfe->absRefPrefix . $icon) . '" width="' . (int)$iconWidth . '" height="' . (int)$iconHeight . '"'
-                    . $this->getBorderAttr(' border="0"') . $this->getAltParam($conf) . ' />';
-            }
-            if ($conf['icon_link'] && !$conf['combinedLink']) {
-                $icon = $this->wrap($icon, $theLinkWrap);
-            }
-            $icon = isset($conf['icon.']) ? $this->stdWrap($icon, $conf['icon.']) : $icon;
-        }
-        $size = '';
-        if ($conf['size'] ?? false) {
-            $size = isset($conf['size.']) ? $this->stdWrap($theSize, $conf['size.']) : $theSize;
-        }
-        // Wrapping file label
-        if ($conf['removePrependedNumbers'] ?? false) {
-            $theValue = preg_replace('/_[0-9][0-9](\\.[[:alnum:]]*)$/', '\\1', $theValue);
-        }
-        if (isset($conf['labelStdWrap.'])) {
-            $theValue = $this->stdWrap($theValue, $conf['labelStdWrap.']);
-        }
-        // Wrapping file
-        $wrap = isset($conf['wrap.'])
-            ? $this->stdWrap($conf['wrap'] ?? '', $conf['wrap.'])
-            : ($conf['wrap'] ?? '');
-        if ($conf['combinedLink'] ?? false) {
-            $theValue = $icon . $theValue;
-            if ($conf['ATagBeforeWrap']) {
-                $theValue = $this->wrap($this->wrap($theValue, $wrap), $theLinkWrap);
-            } else {
-                $theValue = $this->wrap($this->wrap($theValue, $theLinkWrap), $wrap);
-            }
-            $file = isset($conf['file.']) ? $this->stdWrap($theValue, $conf['file.']) : $theValue;
-            // output
-            $output = $file . $size;
-        } else {
-            if ($conf['ATagBeforeWrap'] ?? false) {
-                $theValue = $this->wrap($this->wrap($theValue, $wrap), $theLinkWrap);
-            } else {
-                $theValue = $this->wrap($this->wrap($theValue, $theLinkWrap), $wrap);
-            }
-            $file = isset($conf['file.']) ? $this->stdWrap($theValue, $conf['file.']) : $theValue;
-            // output
-            $output = $icon . $file . $size;
-        }
-        if (isset($conf['stdWrap.'])) {
-            $output = $this->stdWrap($output, $conf['stdWrap.']);
-        }
-        return $output;
-    }
-
-    /**
      * Performs basic mathematical evaluation of the input string. Does NOT take parathesis and operator precedence into account! (for that, see \TYPO3\CMS\Core\Utility\MathUtility::calculateWithPriorityToAdditionAndSubtraction())
      *
      * @param string $val The string to evaluate. Example: "3+4*10/5" will generate "35". Only integer numbers can be used.
@@ -3781,26 +3399,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
     }
 
     /**
-     * This explodes a comma-list into an array where the values are parsed through ContentObjectRender::calc() and cast to (int)(so you are sure to have integers in the output array)
-     * Used to split and calculate min and max values for GMENUs.
-     *
-     * @param string $delim Delimited to explode by
-     * @param string $string The string with parts in (where each part is evaluated by ->calc())
-     * @return array And array with evaluated values.
-     * @see calc(), \TYPO3\CMS\Frontend\ContentObject\Menu\GraphicalMenuContentObject::makeGifs()
-     * @deprecated since TYPO3 v9, will be removed in TYPO3 v10.0. It is solely used in GMENU, which can be handled there directly.
-     */
-    public function calcIntExplode($delim, $string)
-    {
-        trigger_error('calcIntExplode will be removed in TYPO3 v10.0.', E_USER_DEPRECATED);
-        $temp = explode($delim, $string);
-        foreach ($temp as $key => $val) {
-            $temp[$key] = (int)$this->calc($val);
-        }
-        return $temp;
-    }
-
-    /**
      * Implements the "split" property of stdWrap; Splits a string based on a token (given in TypoScript properties), sets the "current" value to each part and then renders a content object pointer to by a number.
      * In classic TypoScript (like 'content (default)'/'styles.content (default)') this is used to render tables, splitting rows and cells by tokens and putting them together again wrapped in <td> tags etc.
      * Implements the "optionSplit" processing of the TypoScript options for each splitted value to parse.
@@ -5621,37 +5219,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
     }
 
     /**
-     * Generates a typolink and returns the two link tags - start and stop - in an array
-     *
-     * @param array $conf "typolink" TypoScript properties
-     * @return array An array with two values in key 0+1, each value being the start and close <a>-tag of the typolink properties being inputted in $conf
-     * @see typolink()
-     * @deprecated since TYPO3 v9.5, will be removed in TYPO3 v10.0. Use typoLink() instead.
-     */
-    public function typolinkWrap($conf)
-    {
-        trigger_error('ContentObjectRenderer->typolinkWrap() will be removed in TYPO3 v10.0. Use $cObj->typoLink() instead.', E_USER_DEPRECATED);
-        $k = md5(microtime());
-        return explode($k, $this->typoLink($k, $conf));
-    }
-
-    /**
-     * Returns the current page URL
-     *
-     * @param array|string $urlParameters As an array key/value pairs represent URL parameters to set. Values NOT URL-encoded yet, keys should be URL-encoded if needed. As a string the parameter is expected to be URL-encoded already.
-     * @param int $id An alternative ID to the current id ($GLOBALS['TSFE']->id)
-     * @return string The URL
-     * @see getTypoLink_URL()
-     * @deprecated since TYPO3 v9.5, will be removed in TYPO3 v10.0. Use getTypoLink_URL() instead.
-     */
-    public function currentPageUrl($urlParameters = [], $id = 0)
-    {
-        trigger_error('ContentObjectRenderer->currentPageUrl() will be removed in TYPO3 v10.0. Use $cObj->getTypoLink_URL() instead.', E_USER_DEPRECATED);
-        $tsfe = $this->getTypoScriptFrontendController();
-        return $this->getTypoLink_URL($id ?: $tsfe->id, $urlParameters, $tsfe->sPre);
-    }
-
-    /**
      * Loops over all configured URL modifier hooks (if available) and returns the generated URL or NULL if no URL was generated.
      *
      * @param string $context The context in which the method is called (e.g. typoLink).
@@ -6172,28 +5739,6 @@ class ContentObjectRenderer implements LoggerAwareInterface
      ***********************************************/
 
     /**
-     * Returns a part of a WHERE clause which will filter out records with start/end times or hidden/fe_groups fields
-     * set to values that should de-select them according to the current time, preview settings or user login.
-     * Definitely a frontend function.
-     * THIS IS A VERY IMPORTANT FUNCTION: Basically you must add the output from this function for EVERY select query you create
-     * for selecting records of tables in your own applications - thus they will always be filtered according to the "enablefields"
-     * configured in TCA
-     * Simply calls \TYPO3\CMS\Frontend\Page\PageRepository::enableFields() BUT will send the show_hidden flag along!
-     * This means this function will work in conjunction with the preview facilities of the frontend engine/Admin Panel.
-     *
-     * @param string $table The table for which to get the where clause
-     * @param bool $show_hidden If set, then you want NOT to filter out hidden records. Otherwise hidden record are filtered based on the current preview settings.
-     * @param array $ignore_array Array you can pass where keys can be "disabled", "starttime", "endtime", "fe_group" (keys from "enablefields" in TCA) and if set they will make sure that part of the clause is not added. Thus disables the specific part of the clause. For previewing etc.
-     * @return string The part of the where clause on the form " AND [fieldname]=0 AND ...". Eg. " AND hidden=0 AND starttime < 123345567
-     * @deprecated since TYPO3 v9.4, will be removed in TYPO3 v10.0.
-     */
-    public function enableFields($table, $show_hidden = false, array $ignore_array = [])
-    {
-        trigger_error('cObj->enableFields() will be removed in TYPO3 v10.0. should be used from the PageRepository->enableFields() functionality directly.', E_USER_DEPRECATED);
-        return $this->getTypoScriptFrontendController()->sys_page->enableFields($table, $show_hidden ? true : -1, $ignore_array);
-    }
-
-    /**
      * Generates a list of Page-uid's from $id. List does not include $id itself
      * (unless the id specified is negative in which case it does!)
      * The only pages WHICH PREVENTS DECENDING in a branch are
index cc94ca4..a830d42 100644 (file)
@@ -1188,7 +1188,6 @@ class PageRepository implements LoggerAwareInterface
      * @param bool $noVersionPreview If set, enableFields will be applied regardless of any versioning preview settings which might otherwise disable enableFields
      * @throws \InvalidArgumentException
      * @return string The clause starting like " AND ...=... AND ...=...
-     * @see \TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer::enableFields()
      */
     public function enableFields($table, $show_hidden = -1, $ignore_array = [], $noVersionPreview = false)
     {
index be2a1f4..b3925a5 100644 (file)
@@ -3639,7 +3639,7 @@ class ContentObjectRendererTest extends UnitTestCase
             }
         }
         $this->assertSame(1, $notCallable);
-        $this->assertSame(85, $callable);
+        $this->assertSame(82, $callable);
     }
 
     /**
@@ -3684,7 +3684,7 @@ class ContentObjectRendererTest extends UnitTestCase
             }
         }
         $this->assertSame($expectExceptions, $exceptions);
-        $this->assertSame(85, $count);
+        $this->assertSame(82, $count);
     }
 
     /***************************************************************************
diff --git a/typo3/sysext/frontend/Tests/UnitDeprecated/ContentObject/ContentObjectRendererTest.php b/typo3/sysext/frontend/Tests/UnitDeprecated/ContentObject/ContentObjectRendererTest.php
deleted file mode 100644 (file)
index 5e76244..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-<?php
-declare(strict_types = 1);
-namespace TYPO3\CMS\Frontend\Tests\UnitDeprecated\ContentObject;
-
-/*
- * This file is part of the TYPO3 CMS project.
- *
- * It is free software; you can redistribute it and/or modify it under
- * the terms of the GNU General Public License, either version 2
- * of the License, or any later version.
- *
- * For the full copyright and license information, please read the
- * LICENSE.txt file that was distributed with this source code.
- *
- * The TYPO3 project - inspiring people to share!
- */
-
-use TYPO3\CMS\Core\Context\Context;
-use TYPO3\CMS\Core\Core\Environment;
-use TYPO3\CMS\Core\Log\Logger;
-use TYPO3\CMS\Core\Package\PackageManager;
-use TYPO3\CMS\Core\TypoScript\TemplateService;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-use TYPO3\CMS\Frontend\ContentObject\CaseContentObject;
-use TYPO3\CMS\Frontend\ContentObject\ContentContentObject;
-use TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayContentObject;
-use TYPO3\CMS\Frontend\ContentObject\ContentObjectArrayInternalContentObject;
-use TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer;
-use TYPO3\CMS\Frontend\ContentObject\EditPanelContentObject;
-use TYPO3\CMS\Frontend\ContentObject\FileContentObject;
-use TYPO3\CMS\Frontend\ContentObject\FilesContentObject;
-use TYPO3\CMS\Frontend\ContentObject\FluidTemplateContentObject;
-use TYPO3\CMS\Frontend\ContentObject\HierarchicalMenuContentObject;
-use TYPO3\CMS\Frontend\ContentObject\ImageContentObject;
-use TYPO3\CMS\Frontend\ContentObject\ImageResourceContentObject;
-use TYPO3\CMS\Frontend\ContentObject\LoadRegisterContentObject;
-use TYPO3\CMS\Frontend\ContentObject\RecordsContentObject;
-use TYPO3\CMS\Frontend\ContentObject\RestoreRegisterContentObject;
-use TYPO3\CMS\Frontend\ContentObject\ScalableVectorGraphicsContentObject;
-use TYPO3\CMS\Frontend\ContentObject\TemplateContentObject;
-use TYPO3\CMS\Frontend\ContentObject\TextContentObject;
-use TYPO3\CMS\Frontend\ContentObject\UserContentObject;
-use TYPO3\CMS\Frontend\ContentObject\UserInternalContentObject;
-use TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController;
-use TYPO3\CMS\Frontend\Page\PageRepository;
-use TYPO3\TestingFramework\Core\Unit\UnitTestCase;
-
-/**
- * Test case
- */
-class ContentObjectRendererTest extends UnitTestCase
-{
-    /**
-     * @var bool Reset singletons created by subject
-     */
-    protected $resetSingletonInstances = true;
-
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject|ContentObjectRenderer
-     */
-    protected $subject;
-
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject|TypoScriptFrontendController
-     */
-    protected $frontendControllerMock;
-
-    /**
-     * @var \PHPUnit_Framework_MockObject_MockObject|TemplateService
-     */
-    protected $templateServiceMock;
-
-    /**
-     * Default content object name -> class name map, shipped with TYPO3 CMS
-     *
-     * @var array
-     */
-    protected $contentObjectMap = [
-        'TEXT' => TextContentObject::class,
-        'CASE' => CaseContentObject::class,
-        'COBJ_ARRAY' => ContentObjectArrayContentObject::class,
-        'COA' => ContentObjectArrayContentObject::class,
-        'COA_INT' => ContentObjectArrayInternalContentObject::class,
-        'USER' => UserContentObject::class,
-        'USER_INT' => UserInternalContentObject::class,
-        'FILE' => FileContentObject::class,
-        'FILES' => FilesContentObject::class,
-        'IMAGE' => ImageContentObject::class,
-        'IMG_RESOURCE' => ImageResourceContentObject::class,
-        'CONTENT' => ContentContentObject::class,
-        'RECORDS' => RecordsContentObject::class,
-        'HMENU' => HierarchicalMenuContentObject::class,
-        'CASEFUNC' => CaseContentObject::class,
-        'LOAD_REGISTER' => LoadRegisterContentObject::class,
-        'RESTORE_REGISTER' => RestoreRegisterContentObject::class,
-        'TEMPLATE' => TemplateContentObject::class,
-        'FLUIDTEMPLATE' => FluidTemplateContentObject::class,
-        'SVG' => ScalableVectorGraphicsContentObject::class,
-        'EDITPANEL' => EditPanelContentObject::class
-    ];
-
-    /**
-     * Set up
-     */
-    protected function setUp(): void
-    {
-        $GLOBALS['SIM_ACCESS_TIME'] = 1534278180;
-        $packageManagerMock = $this->getMockBuilder(PackageManager::class)
-            ->disableOriginalConstructor()
-            ->getMock();
-        $this->templateServiceMock =
-            $this->getMockBuilder(TemplateService::class)
-                ->setConstructorArgs([null, $packageManagerMock])
-                ->setMethods(['linkData'])
-                ->getMock();
-        $pageRepositoryMock =
-            $this->getAccessibleMock(PageRepository::class, ['getRawRecord', 'getMountPointInfo']);
-        $this->frontendControllerMock =
-            $this->getAccessibleMock(
-                TypoScriptFrontendController::class,
-                ['sL'],
-                [],
-                '',
-                false
-            );
-        $this->frontendControllerMock->_set('context', GeneralUtility::makeInstance(Context::class));
-        $this->frontendControllerMock->tmpl = $this->templateServiceMock;
-        $this->frontendControllerMock->config = [];
-        $this->frontendControllerMock->page = [];
-        $this->frontendControllerMock->sys_page = $pageRepositoryMock;
-        $GLOBALS['TSFE'] = $this->frontendControllerMock;
-
-        $this->subject = $this->getAccessibleMock(
-            ContentObjectRenderer::class,
-            ['getResourceFactory', 'getEnvironmentVariable'],
-            [$this->frontendControllerMock]
-        );
-
-        $logger = $this->prophesize(Logger::class);
-        $this->subject->setLogger($logger->reveal());
-        $this->subject->setContentObjectClassMap($this->contentObjectMap);
-        $this->subject->start([], 'tt_content');
-    }
-
-    ////////////////////////////////////
-    // Test concerning link generation
-    ////////////////////////////////////
-
-    /**
-     * @test
-     */
-    public function filelinkCreatesCorrectUrlForFileWithUrlEncodedSpecialChars(): void
-    {
-        $fileNameAndPath = Environment::getPublicPath() . '/typo3temp/var/tests/phpunitJumpUrlTestFile with spaces & amps.txt';
-        file_put_contents($fileNameAndPath, 'Some test data');
-        $relativeFileNameAndPath = substr($fileNameAndPath, strlen(Environment::getPublicPath()) + 1);
-        $fileName = substr($fileNameAndPath, strlen(Environment::getPublicPath() . '/typo3temp/var/tests/'));
-
-        $expectedLink = str_replace('%2F', '/', rawurlencode($relativeFileNameAndPath));
-        $result = $this->subject->filelink($fileName, ['path' => 'typo3temp/var/tests/'], true);
-        $this->assertEquals('<a href="' . $expectedLink . '">' . $fileName . '</a>', $result);
-
-        GeneralUtility::unlink_tempfile($fileNameAndPath);
-    }
-
-    /**
-     * Check that stdWrap_addParams works properly.
-     *
-     * Show:
-     *
-     *  - Delegates to method addParams.
-     *  - Parameter 1 is $content.
-     *  - Parameter 2 is $conf['addParams.'].
-     *  - Returns the return value.
-     *
-     * @test
-     */
-    public function stdWrap_addParams(): void
-    {
-        $content = $this->getUniqueId('content');
-        $conf = [
-            'addParams' => $this->getUniqueId('not used'),
-            'addParams.' => [$this->getUniqueId('addParams.')],
-        ];
-        $return = $this->getUniqueId('return');
-        $subject = $this->getMockBuilder(ContentObjectRenderer::class)
-            ->setMethods(['addParams'])->getMock();
-        $subject
-            ->expects($this->once())
-            ->method('addParams')
-            ->with($content, $conf['addParams.'])
-            ->willReturn($return);
-        $this->assertSame(
-            $return,
-            $subject->stdWrap_addParams($content, $conf)
-        );
-    }
-
-    /**
-     * Check if stdWrap_filelink works properly.
-     *
-     * Show:
-     *
-     * - Delegates to method filelink.
-     * - Parameter 1 is $content.
-     * - Parameter 2 is $conf['filelink.'].
-     * - Returns the return value.
-     *
-     * @test
-     */
-    public function stdWrap_filelink(): void
-    {
-        $content = $this->getUniqueId('content');
-        $conf = [
-            'filelink' => $this->getUniqueId('not used'),
-            'filelink.' => [$this->getUniqueId('filelink.')],
-        ];
-        $subject = $this->getMockBuilder(ContentObjectRenderer::class)
-            ->setMethods(['filelink'])->getMock();
-        $subject->expects($this->once())->method('filelink')
-            ->with($content, $conf['filelink.'])->willReturn('return');
-        $this->assertSame(
-            'return',
-            $subject->stdWrap_filelink($content, $conf)
-        );
-    }
-
-    /**
-     * Check if stdWrap_filelist works properly.
-     *
-     * Show:
-     *
-     * - Delegates to method filelist.
-     * - Parameter is $conf['filelist'].
-     * - Returns the return value.
-     *
-     * @test
-     */
-    public function stdWrap_filelist(): void
-    {
-        $conf = [
-            'filelist' => $this->getUniqueId('filelist'),
-            'filelist.' => [$this->getUniqueId('not used')],
-        ];
-        $subject = $this->getMockBuilder(ContentObjectRenderer::class)
-            ->setMethods(['filelist'])->getMock();
-        $subject->expects($this->once())->method('filelist')
-            ->with($conf['filelist'])->willReturn('return');
-        $this->assertSame(
-            'return',
-            $subject->stdWrap_filelist('discard', $conf)
-        );
-    }
-}
index b35ee5e..ad2a15b 100644 (file)
@@ -2662,7 +2662,8 @@ return [
         'numberOfMandatoryArguments' => 2,
         'maximumNumberOfArguments' => 2,
         'restFiles' => [
-            'Deprecation-85451-ContentObjectRenderer-calcIntExplodeDeprecated.rst'
+            'Deprecation-85451-ContentObjectRenderer-calcIntExplodeDeprecated.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController->getUniqueId' => [
@@ -2676,7 +2677,8 @@ return [
         'numberOfMandatoryArguments' => 1,
         'maximumNumberOfArguments' => 3,
         'restFiles' => [
-            'Deprecation-85558-ContentObjectRenderer-enableFields.rst'
+            'Deprecation-85558-ContentObjectRenderer-enableFields.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Scheduler\Controller\SchedulerModuleController->addMessage' => [
@@ -3616,56 +3618,64 @@ return [
         'numberOfMandatoryArguments' => 0,
         'maximumNumberOfArguments' => 0,
         'restFiles' => [
-            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst'
+            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->stdWrap_filelink' => [
         'numberOfMandatoryArguments' => 0,
         'maximumNumberOfArguments' => 0,
         'restFiles' => [
-            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst'
+            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->stdWrap_filelist' => [
         'numberOfMandatoryArguments' => 0,
         'maximumNumberOfArguments' => 0,
         'restFiles' => [
-            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst'
+            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->addParams' => [
         'numberOfMandatoryArguments' => 0,
         'maximumNumberOfArguments' => 0,
         'restFiles' => [
-            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst'
+            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->filelink' => [
         'numberOfMandatoryArguments' => 0,
         'maximumNumberOfArguments' => 0,
         'restFiles' => [
-            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst'
+            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->filelist' => [
         'numberOfMandatoryArguments' => 0,
         'maximumNumberOfArguments' => 0,
         'restFiles' => [
-            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst'
+            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->typolinkWrap' => [
         'numberOfMandatoryArguments' => 0,
         'maximumNumberOfArguments' => 0,
         'restFiles' => [
-            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst'
+            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Frontend\ContentObject\ContentObjectRenderer->currentPageUrl' => [
         'numberOfMandatoryArguments' => 0,
         'maximumNumberOfArguments' => 0,
         'restFiles' => [
-            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst'
+            'Deprecation-86433-VariousStdWrapFunctionsAndContentObjectRenderer-relatedMethods.rst',
+            'Breaking-87193-DeprecatedFunctionalityRemoved.rst',
         ],
     ],
     'TYPO3\CMS\Core\TypoScript\TemplateService->prependStaticExtra' => [