Issue Bug Closed

#99648The method getPageAndRootline in TypoScriptFrontendController can throw the PHP warning : Undefined array key "hidden" in ...

Thomas Hohn 01/19/23, 13:25 updated 03/14/23, 11:47

Description

In the TypoScriptFrontendController there is the following code:

 if (!empty($hiddenField) && !$includeHiddenPages) {
                    // Page is "hidden" => 404 (deliberately done in default language, as this cascades to language overlays)
                    $rawPageRecord = $this->sys_page->getPage_noCheck($this->id);
                    $requestedPageIsHidden = (bool)$rawPageRecord[$hiddenField];
                }

If a non-existing id is provided the $rawPageRecord will be the empty array and hence the line

$requestedPageIsHidden

will throw an error the line should instead be

$requestedPageIsHidden = (bool)(isset($rawPageRecord[$hiddenField] ?: false);

Reviews 3

History 312

  1. Gerrit Code Review pushed patch set 1 for main to change 77504 status New Under Review 01/19/23, 13:58

  2. Gerrit Code Review pushed patch set 1 for main to change 77505 01/19/23, 14:32

  3. Gerrit Code Review pushed patch set 2 for main to change 77505 01/19/23, 16:09

  4. Gerrit Code Review pushed patch set 3 for main to change 77505 01/19/23, 16:10

  5. Gerrit Code Review pushed patch set 4 for main to change 77505 01/23/23, 06:28

  6. Gerrit Code Review pushed patch set 5 for main to change 77505 01/24/23, 05:58

  7. Gerrit Code Review pushed patch set 6 for main to change 77505 01/24/23, 08:56

  8. Thomas Hohn changed assigned to Thomas Hohn 02/28/23, 19:39

  9. Gerrit Code Review pushed patch set 7 for main to change 77505 03/06/23, 05:41

  10. Gerrit Code Review pushed patch set 1 for 11.5 to change 77968 03/06/23, 08:34

  11. Thomas Hohn commented and changed status Under Review Resolved done 0 % 100 % 03/06/23, 08:40

    Applied in changeset commit:8e52a486e01ef45c3e348f25e19ae0aa78fcbd75.

  12. Benni Mack changed status Resolved Closed 03/14/23, 11:47