Issue Bug Closed

#73493Check if page really exists for TypoScript "browse" menu

Markus Hölzle 02/16/16, 15:11 updated 10/02/18, 11:20

Description

Hi there,

I found a bug in the AbstractMenuContentObject class in line 1103 (TYPO3 version 7.6.3). The TypoScript HMENU “special = browse” ( items = next|prev ) tries to generate links although the page is not accessible because of a TypoScript condition (PIDupinRootline ). This results in an SQL error because ‘pid in ()’ is not allowed ( will be called in the following function “$this->sys_page->getMenu(…)”).

The TYPO3 core check whether the possible site is an array but not whether the array is empty.

\TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject line 1103

// prevsection / nextsection is found
// You can only do this, if there is a valid page two levels up!
if (is_array($recArr['index'])) {

should be changed to:

// prevsection / nextsection is found
// You can only do this, if there is a valid page two levels up!
if (empty($recArr['index']) === false && is_array($recArr['index'])) {

Reviews 2