Project

General

Profile

Actions

Bug #92508

closed

hook filterMenuPages never has access to config

Added by David Bruchmann over 3 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2020-10-07
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
10
PHP Version:
7.3
Tags:
hook, xclass, filter, menu
Complexity:
Is Regression:
Sprint Focus:

Description

Hooking functions created with
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['cms/tslib/class.tslib_menu.php']['filterMenuPages'][]
(defined in TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject)

never have access to the capsulated configuration as there isn't any function to expose the values.
For a bit more complicated challenges this hook is therefore useless.

The ugly but possible alternative is an XCLASS.

EDIT:
-----

More detailed, using the hook the following interface is mandatory:

/**
 * interface for classes which hook into AbstractMenuContentObject
 */
interface AbstractMenuFilterPagesHookInterface
{
    /**
     * Checks if a page is OK to include in the final menu item array.
     *
     * @param array $data Array of menu items
     * @param array $banUidArray Array of page uids which are to be excluded
     * @param bool $spacer If set, then the page is a spacer.
     * @param \TYPO3\CMS\Frontend\ContentObject\Menu\AbstractMenuContentObject $obj The menu object
     * @return bool Returns TRUE if the page can be safely included.
     */
    public function processFilter(array &$data, array $banUidArray, $spacer, AbstractMenuContentObject $obj);
}

All the parameters of processFilter() are filled with values, but most of them can't be accessed because the are protected and never have getter-methods.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #101006: Remove deprecated functionality related to link handling and ContentObjectRendererClosedBenni Mack2023-06-12

Actions
Actions #2

Updated by David Bruchmann over 3 years ago

  • Description updated (diff)
Actions #3

Updated by Gerrit Code Review over 2 years ago

  • Status changed from New to Under Review

Patch set 5 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72955

Actions #4

Updated by Gerrit Code Review over 2 years ago

Patch set 6 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72955

Actions #5

Updated by Gerrit Code Review over 2 years ago

Patch set 7 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72955

Actions #6

Updated by Gerrit Code Review over 2 years ago

Patch set 8 for branch main of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/72955

Actions #7

Updated by Benni Mack over 2 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #8

Updated by Benni Mack over 1 year ago

  • Status changed from Resolved to Closed
Actions #9

Updated by Benni Mack 10 months ago

  • Related to Task #101006: Remove deprecated functionality related to link handling and ContentObjectRenderer added
Actions #10

Updated by Benni Mack 10 months ago

  • Related to deleted (Task #101006: Remove deprecated functionality related to link handling and ContentObjectRenderer)
Actions #11

Updated by Benni Mack 10 months ago

  • Related to Task #101006: Remove deprecated functionality related to link handling and ContentObjectRenderer added
Actions

Also available in: Atom PDF