---
title: "Important: The select item event declares what TYPO3 passes"
manual: "Academic Base"
version: "main"
permalink: "https://docs.typo3.org/permalink/fgtclb/academic-base:important-select-item-event-declares-what-typo3-passes@main"
source: "Changelog/2.4/Important-SelectItemEventDeclaresWhatTypo3Passes.rst"
rendered: "2026-10-17T08:47:46+00:00"
---

# Important: The select item event declares what TYPO3 passes {#important-select-item-event-declares-what-typo3-passes}

## Description {#description}

`\FGTCLB\AcademicBase\Event\ModifyTcaSelectFieldItemsEvent` declares the
parameters of an `itemsProcFunc` as a PHPStan array shape, and the item
providers that dispatch the event repeated that shape. Three keys of it were
declared narrower than TYPO3 fills them in the backend form:

| Key | Declared | Passed by TYPO3 v12, v13 and v14 |
| --- | --- | --- |
| `inlineParentUid`, `inlineTopMostParentUid` | `int` | The empty string `''` for a record that is not edited as an inline child. A `NEW...` string for a parent that is not saved yet. Otherwise the uid of the parent, as an integer or a numeric string. The site configuration passes `null` as `inlineTopMostParentUid`. |
| `site` | `Site\|null` | A `\TYPO3\CMS\Core\Site\Entity\NullSite` for a record outside any site, on page 0 for example. |
| `items` | arrays | `\TYPO3\CMS\Core\Schema\Struct\SelectItem` objects for the items TYPO3 built before the item provider ran, the static items of the field among them. The items a provider adds are arrays. |

The event declares the shape once now, as the PHPStan type alias
`ItemsProcFuncParameters`, with `int|string` for
`inlineParentUid`, `int|string|null` for
`inlineTopMostParentUid`,
`\TYPO3\CMS\Core\Site\Entity\SiteInterface|null` for `site`,
and `SelectItem` or an array for an item. The item providers of
[`fgtclb/academic-jobs`](https://packagist.org/packages/fgtclb/academic-jobs), [`fgtclb/academic-persons`](https://packagist.org/packages/fgtclb/academic-persons) and
[`fgtclb/academic-contacts4pages`](https://packagist.org/packages/fgtclb/academic-contacts4pages) import it. The providers of
[`fgtclb/academic-persons`](https://packagist.org/packages/fgtclb/academic-persons) and
[`fgtclb/academic-contacts4pages`](https://packagist.org/packages/fgtclb/academic-contacts4pages) therefore declare `row`
optional as well, as the event does since
[Important: The select item helper passes an empty row](https://docs.typo3.org/permalink/fgtclb/academic-base:important-select-item-helper-passes-an-empty-row@main).

Only the declaration changes. TYPO3 passed these values before, and the item
providers pass them on unchanged.

## Impact {#impact}

A listener that static analysis accepted could fail at runtime for the common
case. One that passes `$parameters['inlineParentUid']` to a parameter
typed `int` raises a `\TypeError` for every record that is not
edited as an inline child. One that calls a method only `Site` has on
`$parameters['site']` fails for a record outside any site. One that
types the item of a closure as `array` raises a `\TypeError` for a
field with static items. Static analysis reports such a listener now.

Cast an inline uid and use it only when it is above 0, check the site before
calling a method of `Site`, and type an item as `array|SelectItem`:

```php
$parentUid = (int)($parameters['inlineParentUid'] ?? 0);
if ($parentUid > 0) {
    // The record is edited as an inline child of a saved parent.
}
$site = $parameters['site'] ?? null;
if ($site instanceof \TYPO3\CMS\Core\Site\Entity\Site) {
    $settings = $site->getSettings();
}
$values = array_map(
    static fn(array|\TYPO3\CMS\Core\Schema\Struct\SelectItem $item): string => (string)($item['value'] ?? ''),
    $parameters['items'],
);
```

A listener or an item provider of a project can import the alias instead of
repeating the shape:

```php
/**
 * @phpstan-import-type ItemsProcFuncParameters from \FGTCLB\AcademicBase\Event\ModifyTcaSelectFieldItemsEvent
 */
```

## Affected Installations {#affected-installations}

Installations with a listener of
`\FGTCLB\AcademicBase\Event\ModifyTcaSelectFieldItemsEvent`, or with code
that calls one of the item providers of the academic extensions, that is
checked by static analysis. The listener reports point at code that already
failed or misbehaved at runtime.
