Project

General

Profile

Actions

Bug #99467

closed

Error on opening infowindow of referenced records

Added by Surena Golijani over 1 year ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Backend JavaScript
Target version:
-
Start date:
2023-01-05
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.0
Tags:
Complexity:
Is Regression:
Sprint Focus:
On Location Sprint

Description

Error on opening infowindow of referenced records

TYPO3 version: 11.5.21
tested on current chrome and firefox

  • Record A has an image field
  • Record A is referenced in record B
On opening the edit view of the respective record and clicking the i-icon to open the infowindow, the following happens:
  • opening record A directly: the infowindow is shown
  • opening record B, then opening a referenced record A and clicking on it's image fields i-icon: JavaScript-error is thrown

I.e. the infowindow opens if the record is opened directly, but not if the record is opened as a referenced record of another record.

This behaviour is reproducable in different TYPO3 installations with different record types.

Example:

Error message:

Chrome:

Uncaught TypeError: Cannot read properties of undefined (reading 'moduleUrl')
    at i.showItem (InfoWindow.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13:206)
    at HTMLButtonElement.<anonymous> (InlineControlContainer.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13:7735)
    at HTMLDivElement.<anonymous> (RegularEvent.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13:364)
showItem @ InfoWindow.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13
(anonymous) @ InlineControlContainer.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13
(anonymous) @ RegularEvent.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13

Firefox:

Uncaught TypeError: top.TYPO3.settings.ShowItem is undefined
    showItem https://domain.tld/typo3/sysext/backend/Resources/Public/JavaScript/InfoWindow.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13
    registerInfoButton https://domain.tld/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/Container/InlineControlContainer.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13
    delegateTo https://domain.tld/typo3/sysext/core/Resources/Public/JavaScript/Event/RegularEvent.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13
InfoWindow.js:13:170
    showItem https://domain.tld/typo3/sysext/backend/Resources/Public/JavaScript/InfoWindow.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13
    registerInfoButton https://domain.tld/typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/Container/InlineControlContainer.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13
    delegateTo https://domain.tld/typo3/sysext/core/Resources/Public/JavaScript/Event/RegularEvent.js?bust=c3eda0df4dff79b17d01b36b63ccea5f1f0b26ca:13

TCA definition of record A's image field:

        'images' => [
            'label' => 'LLL:EXT:core/Resources/Private/Language/locallang_general.xlf:LGL.image',
            'config' => \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::getFileFieldTCAConfig(
                'images', [
                'appearance' => [
                    'createNewRelationLinkTitle' => 'LLL:EXT:frontend/Resources/Private/Language/locallang_ttc.xlf:images.addFileReference'
                ],
                'maxitems' => 10,
                'foreign_match_fields' => [
                    'fieldname' => 'images',
                    'tablenames' => 'tx_abc_domain_model_productcategory',
                    'table_local' => 'sys_file',
                ],
                'foreign_types' => [
                    '0' => [
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                            --palette--;;filePalette'
                    ],
                    \TYPO3\CMS\Core\Resource\File::FILETYPE_IMAGE => [
                        'showitem' => '
                            --palette--;LLL:EXT:lang/locallang_tca.xlf:sys_file_reference.imageoverlayPalette;imageoverlayPalette,
                            --palette--;;filePalette'
                    ]
                ]
            ], $GLOBALS['TYPO3_CONF_VARS']['GFX']['imagefile_ext'])
        ]

Files

referenced_records_infowindow.png (889 KB) referenced_records_infowindow.png Surena Golijani, 2023-01-05 13:21

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #104147: Info of inline record doesn't work when current module is opened within a new tabClosedDaniel Gohlke2024-06-18

Actions
Actions #1

Updated by Benni Mack about 1 year ago

  • Sprint Focus set to On Location Sprint
Actions #2

Updated by Daniel Gohlke about 2 months ago

  • Related to Bug #104147: Info of inline record doesn't work when current module is opened within a new tab added
Actions #3

Updated by Daniel Gohlke about 2 months ago

Can you check if patching typo3/sysext/backend/Classes/Controller/EditDocumentController.php fix your problem?

Actions #4

Updated by Gerrit Code Review about 2 months ago

  • Status changed from New to Under Review

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/+/84779

Actions #5

Updated by Gerrit Code Review about 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/+/84754

Actions #6

Updated by Gerrit Code Review about 2 months ago

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

Actions #7

Updated by Daniel Gohlke about 2 months ago

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

Updated by Benni Mack about 1 month ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF