Project

General

Profile

Actions

Bug #103384

closed

PHP Warning: Undefined array key "divKey"

Added by Pascal Geldmacher 8 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2024-03-13
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.3
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Since TYPO3 12 I get these warnings:

Core: Error handler (FE): PHP Warning: Undefined array key "divKey" in /var/www/html/vendor/typo3/cms-frontend/Classes/Controller/TypoScriptFrontendController.php line 2237
Core: Error handler (FE): PHP Warning: Undefined array key "divKey" in /var/www/html/vendor/typo3/cms-frontend/Classes/Controller/TypoScriptFrontendController.php line 2231
Core: Error handler (FE): PHP Warning: Undefined array key "divKey" in /var/www/html/vendor/typo3/cms-frontend/Classes/Controller/TypoScriptFrontendController.php line 2230

if I use this TypoScript snippet on a specific page:

page.bodyTagCObject {
    998 = TEXT
    998 {
        value = data-etracker-form-category="Sample" 
    }

    999 = TEXT
    999 {
        noTrimWrap = | |
        value.cObject = CONTENT
        value.cObject {
            table = tx_ofproduct_domain_model_article
            select {
                selectFields = title
                uidInList = {session:sample}
                uidInList.insertData = 1
                pidInList = 0
                max = 1
            }

            renderObj = COA_INT
            renderObj {
                10 = TEXT
                10 {
                    field = title
                    noTrimWrap = | data-etracker-form-object="|" |
                }
            }
        }
    }
}

If I remove the part with the COA_INT I don't get these warnings.

Related issues 1 (0 open1 closed)

Has duplicate TYPO3 Core - Bug #104251: Having a USER_INT OR COA_INT on page.bodyTagCObject leads to Warning errorClosed2024-06-28

Actions
Actions #1

Updated by Georg Ringer 8 months ago

can you copy which lines are on the specific line number as I can't reproduce it here

Actions #2

Updated by Pascal Geldmacher 8 months ago

That's the lines in the TYPO3 Core where I get the warnings:

$this->content = str_replace(
            [
                '<!--HD_' . $this->config['INTincScript_ext']['divKey'] . '-->',
                '<!--FD_' . $this->config['INTincScript_ext']['divKey'] . '-->',
            ],
            [
                implode(LF, $this->additionalHeaderData),
                implode(LF, $this->additionalFooterData),
            ],
            $this->pageRenderer->renderJavaScriptAndCssForProcessingOfUncachedContentObjects($this->content, $this->config['INTincScript_ext']['divKey'])
        );

in this function:

 public function INTincScript(ServerRequestInterface $request): void
    {
        $this->additionalHeaderData = $this->config['INTincScript_ext']['additionalHeaderData'] ?? [];
        $this->additionalFooterData = $this->config['INTincScript_ext']['additionalFooterData'] ?? [];
        if (empty($this->config['INTincScript_ext']['pageRendererState'])) {
            $this->initPageRenderer();
        } else {
            $pageRendererState = unserialize($this->config['INTincScript_ext']['pageRendererState'], ['allowed_classes' => [Locale::class]]);
            $this->pageRenderer->updateState($pageRendererState);
        }
        if (!empty($this->config['INTincScript_ext']['assetCollectorState'])) {
            $assetCollectorState = unserialize($this->config['INTincScript_ext']['assetCollectorState'], ['allowed_classes' => false]);
            GeneralUtility::makeInstance(AssetCollector::class)->updateState($assetCollectorState);
        }

        $this->recursivelyReplaceIntPlaceholdersInContent($request);
        $this->getTimeTracker()->push('Substitute header section');
        $this->INTincScript_loadJSCode();
        $this->generatePageTitle();

        $this->content = str_replace(
            [
                '<!--HD_' . $this->config['INTincScript_ext']['divKey'] . '-->',
                '<!--FD_' . $this->config['INTincScript_ext']['divKey'] . '-->',
            ],
            [
                implode(LF, $this->additionalHeaderData),
                implode(LF, $this->additionalFooterData),
            ],
            $this->pageRenderer->renderJavaScriptAndCssForProcessingOfUncachedContentObjects($this->content, $this->config['INTincScript_ext']['divKey'])
        );
        // Replace again, because header and footer data and page renderer replacements may introduce additional placeholders (see #44825)
        $this->recursivelyReplaceIntPlaceholdersInContent($request);
        $this->setAbsRefPrefix();
        $this->getTimeTracker()->pull();
    }
Actions #3

Updated by Gerrit Code Review 8 months ago

  • Status changed from New to Under Review

Patch set 1 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/+/83525

Actions #4

Updated by Georg Ringer 8 months ago

tested it with

page.bodyTagCObject = COA
page.bodyTagCObject {
    998 = TEXT
    998 {
        value = data-etracker-form-category="Sample" 
    }

    999 =COA_INT
    999 {

      10 = TEXT
      10.value = abc
    }
}

thanks for your feedback!

Actions #5

Updated by Georg Ringer 5 months ago

  • Has duplicate Bug #104251: Having a USER_INT OR COA_INT on page.bodyTagCObject leads to Warning error added
Actions #6

Updated by Gerrit Code Review 2 months ago

Patch set 2 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/+/83525

Actions #7

Updated by Gerrit Code Review 2 months ago

Patch set 3 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/+/83525

Actions #8

Updated by Gerrit Code Review 2 months ago

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

Actions #9

Updated by Georg Ringer 2 months ago

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

Updated by Benni Mack about 1 month ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF