Issue Bug Closed

#104664PHP warning for HMENU browse and unaccessable special.value

Philipp Kitzberger 08/19/24, 15:51 updated 10/15/24, 09:09

Description

When setting special.value to a non-existing UID or a hidden page the HMENU “browse” produces one of those PHP 8 warnings:
> PHP Warning: Undefined array key “pid” in EXT:frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php line 988

974  protected function prepareMenuItemsForBrowseMenu($specialValue, $sortingField, $additionalWhere)
...
988     if ($value_rec['pid']) {
989        // The page record of 'up'.
990        $recArr['up'] = $this->sys_page->getPage((int)$value_rec['pid'], $this->disableGroupAccessCheck);
991     }

Example TypoScript:

page.10 = HMENU
page.10 {
  special = browse
  special.items = next
  special.value = 1234567890
  1 = TMENU
  1.NO {
    wrap = |
  }
}

Reviews 2

History 26

  1. Gerrit Code Review pushed patch set 1 for main to change 86451 status New Under Review 10/07/24, 14:31

  2. Gerrit Code Review pushed patch set 2 for main to change 86451 10/07/24, 19:56

  3. Gerrit Code Review pushed patch set 3 for main to change 86451 10/08/24, 14:30

  4. Gerrit Code Review pushed patch set 1 for 12.4 to change 86549 10/10/24, 16:48

  5. Benni Mack commented and changed status Under Review Resolved done 0 % 100 % 10/10/24, 17:00

    Applied in changeset commit:d3883dd398e3cdadfaa080cf0f75363760b5f778.

  6. Benni Mack changed status Resolved Closed 10/15/24, 09:09