#103092Persisting File reference on new page gets pid 0 instead of the pid of the record
Description
Hello everyone,
unfortunately I can reproduce the “problem” of the already solved bug https://forge.typo3.org/issues/82931 in our TYPO3 12LTS (12.4.10).
Could someone take a look at it?
Thanks in advance
Here is the content of the linked bug as a quote:
> Steps to reproduce:
> Go to ‘list’ mode (You can use ‘Create New’ wizard also)
> Create a new page (so it has uid NEW_*)
> Attach a resource like an image
> Save the record
> Expected behavior:
> The sys_file_reference entry has a pid of the newly created page
> Observed behavior:
> The sys_file_reference entry has a pid of 0
> Result:
> A regular ‘mortal’ user can never remove the reference from the page object because it has no access to remove stuff from pid 0.
> I only observed this behavior in page records. tt_content for example, seems to work fine
Reviews 3
Related issues 1
Files 1
History 913
-
Sybille Peters changed Related to #82931 <span data-processor="relativetime" data-value="2024-02-09T15:37:25+00:00" > 02/09/24, 15:37 </span>
-
Sybille Peters commented <span data-processor="relativetime" data-value="2024-02-09T15:47:47+00:00" > 02/09/24, 15:47 </span>
-
Georg Ringer commented and changed status
NewAccepted <span data-processor="relativetime" data-value="2025-04-03T11:15:53+00:00" > 04/03/25, 11:15 </span>can be still confirmed on main (14-0)
-
Georg Ringer changed subject
TYPO3 12LTS | php8.1 | File reference on new page gets pid 0 instead of the pid of the recordPersisting File reference on new page gets pid 0 instead of the pid of the record <span data-processor="relativetime" data-value="2025-04-03T11:16:07+00:00" > 04/03/25, 11:16 </span> -
Georg Großberger commented <span data-processor="relativetime" data-value="2025-08-22T12:33:35+00:00" > 08/22/25, 12:33 </span>
The problem seems to be in \TYPO3\CMS\Backend\Form\Container\FileReferenceContainer::render: The HTML has a form field
[pid]with the UID of the parent record. That value is cast to an integer, which yields0if the PID of the parent record is aNEW...reference. -
Gerrit Code Review pushed patch set 1 for main to change 90474 status
AcceptedUnder Review <span data-processor="relativetime" data-value="2025-08-22T12:37:05+00:00" > 08/22/25, 12:37 </span> -
Gerrit Code Review pushed patch set 2 for main to change 90474 <span data-processor="relativetime" data-value="2025-08-22T12:37:39+00:00" > 08/22/25, 12:37 </span>
-
Christian Kuhn commented <span data-processor="relativetime" data-value="2025-08-22T13:21:06+00:00" > 08/22/25, 13:21 </span>
Note: ext:dbdoctor fixes affected existing sys_file_reference records by updating to correct pid.
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 90476 <span data-processor="relativetime" data-value="2025-08-22T13:26:10+00:00" > 08/22/25, 13:26 </span>
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 90477 <span data-processor="relativetime" data-value="2025-08-22T13:26:24+00:00" > 08/22/25, 13:26 </span>
-
Anonymous commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2025-08-22T13:50:12+00:00" > 08/22/25, 13:50 </span>Applied in changeset commit:cfc640ba873e6ca554ff322a09547e69c41f0764.
-
Christian Kuhn changed Duplicated by #107334 <span data-processor="relativetime" data-value="2025-08-26T17:35:15+00:00" > 08/26/25, 17:35 </span>
-
Benni Mack changed status
ResolvedClosed <span data-processor="relativetime" data-value="2025-12-02T14:33:20+00:00" > 12/02/25, 14:33 </span>
I could reproduce this in latest v12 and v13 via the description – important is to use list module and not save page until the the file reference is created.