Why? : Data structure identifier must be set, typically by executing TcaFlexPrepare data provider before

Hello,

I’m trying to upgrade my extensions to 14.3. But even the simplest extensions won’t work…

Topic: Flex forms

I know the API is deprecated, but it should still work.
File: Configuration/TCA/Overrides/tt_content_plugin_cycontentstatistics_statistics.php :

<?php

defined('TYPO3') or die();

use TYPO3\CMS\Core\Schema\Struct\SelectItem;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;

$extension = 'cyContentStatistics';
$extensionDir = 'cy_content_statistics';
$plugin = 'statistics';

$signature = strtolower("{$extension}_{$plugin}");
$iconIdentifier = "{$extension}-{$plugin}";

$translationPath = "LLL:EXT:{$extensionDir}/Resources/Private/Language/locallang_be_{$plugin}.xlf:";

// Register the plugin
ExtensionManagementUtility::addPlugin(
    new SelectItem(
        $signature,
        "{$translationPath}plugin.name",
        $iconIdentifier,
        "FILE:EXT:{$extensionDir}/Resources/Public/Icons/Extension.svg",
        $extension,
        "{$translationPath}plugin.description",
    ),
    'CType',
    $extension
);

// Add to all TCA types
ExtensionManagementUtility::addToAllTCAtypes(
    'tt_content',
    "--div--;{$translationPath}flexforms_general.title, pi_flexform, pages",
    $signature,
    'after:palette:headers'
);

// Register the FlexForm
ExtensionManagementUtility::addPiFlexFormValue(
    $signature,
    "FILE:EXT:{$extensionDir}/Configuration/Flexforms/{$plugin}.xml",
);

But I’m getting the error:

(1/1) #1480765571 RuntimeException “Data structure identifier must be set, typically by executing TcaFlexPrepare data provider before”

And the documentation says I should use “FILE:EXT:”, which I am doing. What am I missing?

Thanks for helpful ideas…

Clemens

Hi Clemens,

This isn’t actually about the FILE: prefix — that part is correct. It’s an argument-order mix-up in addPiFlexFormValue().

You register the plugin as a CType (addPlugin(..., 'CType', ...)), but then call:

ExtensionManagementUtility::addPiFlexFormValue(
    $signature,
    "FILE:EXT:{$extensionDir}/Configuration/Flexforms/{$plugin}.xml",
);

The signature addPiFlexFormValue($piKeyToMatch, $value, $CTypeToMatch = '*') matches $piKeyToMatch against list_type. Since your plugin has no list_type at all, putting $signature there registers a ds entry that never matches the ds_pointerField (list_type,CType) TYPO3 resolves at runtime for a CType-based element. No matching entry → no data structure identifier → the TcaFlexPrepare provider never sets it → TcaFlexProcess throws #1480765571.

Fix: swap the arguments so the CType goes into the third parameter instead:

ExtensionManagementUtility::addPiFlexFormValue(
    '*',
    "FILE:EXT:{$extensionDir}/Configuration/Flexforms/{$plugin}.xml",
    $signature
);

This matches the “correct way” example in the exception docs'*' first, CType third. This isn’t new in 14.3; it’s a longstanding call-signature quirk that used to fail more silently and now surfaces as a hard exception under the newer Schema-based flex handling.

AI: Answer by Claude Sonnet 5

Thanks for your help, but AI isn’t much help here—I’ve already tried that. You never know for sure if the AI is up to date enough to properly understand the new APIs.

ExtensionManagementUtility::addPiFlexFormValue() ist depecated.

If I understand the documentation correctly, you can register FlexForms using ExtensionManagementUtility::addPlugin().

That’s why I tried the following… always the same error message:

<?
defined('TYPO3') or die();
use TYPO3\CMS\Core\Schema\Struct\SelectItem;
use TYPO3\CMS\Core\Utility\ExtensionManagementUtility;
defined('TYPO3') or die();
$extension = 'cyContentStatistics';
$extensionDir = 'cy_content_statistics';
$plugin = 'statistics';
$signatur = strtolower("{$extension}_{$plugin}");
$iconIdentifier = "{$extension}-{$plugin}";
$translationPath = "LLL:EXT:{$extensionDir}/Resources/Private/Language/locallang_be_{$plugin}.xlf:";
ExtensionManagementUtility::addPlugin(
    $itemArray =  new SelectItem(
        $type ='select',
        $label = "{$translationPath}plugin.name",
        $value =  $signatur,
        $icon = "FILE:EXT:{$extensionDir}/Resources/Public/Icons/Extension.svg",
        $group = $extension,
        $descriptuion = "{$translationPath}plugin.description" 
    ), 
    $flexFormflexForm = "FILE:EXT:{$extensionDir}/Configuration/Flexforms/{$plugin}.xml"
);
ExtensionManagementUtility::addToAllTCAtypes(
    'tt_content',
    "--div--;{$translationPath}flexforms_general.title, pi_flexform, pages",
    $signatur,
    'after:palette:headers'
);

It’s really frustrating - the FE plugin no longer appears correctly in the Content Element menu (no text, no icon), the FlexForms don’t work anymore, the templates can’t be found on the page, and the content setup.typoscript no longer shows up in TYPO3.

I’ve been using TYPO3 since version 3.5, but I’ve never experienced so many breaking changes with a major release before.

It seems there’s fundamentally something wrong going on. My starter extension that I wanted to begin porting to 14.3 isn’t particularly complicated: https://github.com/docmcfly/cyContentStatistics (this version works on Typo3 13.4)

What am I doing wrong?

Thank for helpful ideas…

The extension-key in your composer.json is set to "cycontentstatistics" (no underscore), but your code references EXT:cy_content_statistics/... everywhere (with underscore). In TYPO3 v13 this worked because ext_emconf.php was still consulted as a fallback for key resolution, so this mismatch was masked (especially in non-composer mode). In TYPO3 v14 (as documented in composer.json — TYPO3 Explained 14.3 documentation), composer.json is the single source of truth (in both Composer and Classic modes) and ext_emconf.php is no longer used for that purpose, so EXT:cy_content_statistics/... path lookups fail. The flexform data structure is never found, TcaFlexPrepare can’t set an identifier, and TcaFlexProcess throws an exception #1480765571.

Change your composer.json:

"extra": {
  "typo3/cms": {
    "extension-key": "cy_content_statistics"
  }
}