Issue Bug Closed

#95814 The itemsProcFunc configuration array has wrong pid from the 2nd content element on a page

Andreas Kalkhoff 10/29/21, 06:30 updated 06/11/24, 22:58

Description

I use an itemProcFunc to fill flexform items based on heritage-based data; filling an array of colors for editors to use which may differ based on the site they are editing.
This seems to be a regression considering issue #50551. Georg Ringer advised to use “$config[‘flexParentDatabaseRow’][‘pid’]” as solution to that issue as the code base changed a lot since the creation of said issue.
$config[‘flexParentDatabaseRow’][‘pid’] however seems to have the same issue:
When I click “+ Content” after any element on a page “$config[‘flexParentDatabaseRow’][‘pid’]” returns that prior element’s uid as negative as pid. I do only get the proper pid on the topmost “+ Content” that’s not affiliated to a content element.

E.g.:
On Page ID 345
(1) “+ Content“
(2) tt_content element uid 123 (any type, text or whatever)
(3) “+ Content”

=>

(1) $config[‘flexParentDatabaseRow’][‘pid’] returns “345“
(3) $config[‘flexParentDatabaseRow’][‘pid’] returns “-123”

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.