Project

General

Profile

Actions

Bug #98181

closed

Undefined in array key in workspaceOL method

Added by Armin Vieweg over 1 year ago. Updated 10 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
FormEngine aka TCEforms
Target version:
-
Start date:
2022-08-19
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
11
PHP Version:
8.1
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

When using EXT:container in TYPO3 11.5.14 with enabled (not live) workspaces, the content element properties does not show up, instead this exception occures:

PHP Warning: Undefined array key "pid" in /www/htdocs/***/vendor/typo3/cms-backend/Classes/Utility/BackendUtility.php line 3432

This line is the following:

// When a moved record is found the "PID" value contains the newly moved location
// Whereas the _ORIG_pid field contains the PID of the live version
$wsAlt['_ORIG_pid'] = $row['pid'];

But, it can happen that the key "pid" is not set in $row.

When wrapping a isset($row['pid']) condition around, the exception does not appear anymore.

The workspaceOL method has been called by: /vendor/typo3/cms-backend/Classes/Form/FormDataProvider/AbstractItemProvider.php line 371


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #101443: Exception 'Undefined array key "pid"' after moving content in a workspaceClosed2023-07-25

Actions
Actions #1

Updated by Oliver Hader over 1 year ago

  • Category changed from Workspaces to FormEngine aka TCEforms

$queryBuilder = $this->buildForeignTableQueryBuilder($result, $fieldName); uses BackendUtility::getCommonSelectFields($foreignTableName, $foreignTableName . '.') in order to get the corresponding database QueryBuilder instance - however, this utility function does NOT add pid as field, which leads to the mentioned scenario.

Actions #2

Updated by Oliver Hader over 1 year ago

  • Status changed from New to Accepted
Actions #3

Updated by Gerrit Code Review over 1 year ago

  • Status changed from Accepted 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/+/75532

Actions #4

Updated by Gerrit Code Review over 1 year 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/+/75532

Actions #5

Updated by Armin Vieweg over 1 year ago

I discovered that calling ContentObjectRenderer->getTreeList() will also cause a similar exception:

PHP Warning: Undefined array key "pid" in /www/htdocs/abc123/vendor/typo3/cms-core/Classes/Domain/Repository/PageRepository.php line 1693

When I add "pid" to select fields, the error is gone, but the result is not respecting pages which are not located in the current workspace, but are published.

Actions #6

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

Actions #7

Updated by Gerrit Code Review 10 months ago

Patch set 4 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/+/75532

Actions #8

Updated by Gerrit Code Review 10 months ago

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

Actions #9

Updated by Christian Kuhn 10 months ago

confirmed. we stumbled upon that with a tt_content CE having a field to select pages. in workspaces the overlay then crashes since 'pid' is missing.

Actions #10

Updated by Gerrit Code Review 10 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/+/80042

Actions #11

Updated by Gerrit Code Review 10 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/+/80043

Actions #12

Updated by Georg Ringer 10 months ago

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

Updated by Benni Mack 10 months ago

  • Related to Bug #101443: Exception 'Undefined array key "pid"' after moving content in a workspace added
Actions

Also available in: Atom PDF