Commit 378647ec authored by Nicole Cordes's avatar Nicole Cordes
Browse files

[BUGFIX] TCA: Make ###CURRENT_PID### work in foreign_table_where in IRRE

The patch adds the current database row to the data passed to the select
field rendered by foreign_selector of IRRE.
This data is necessary to properly resolve the ###CURRENT_PID### marker
in a foreign_table_where clause.

Resolves: #78960
Releases: master, 7.6
Change-Id: I17f6b4a78d20c101ef7caab227d23c87f138e8ce
Reviewed-on: https://review.typo3.org/50934

Reviewed-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein's avatarMarkus Klein <markus.klein@typo3.org>
Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Tested-by: default avatarJasmina Ließmann <code@frauliessmann.de>
Reviewed-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes's avatarNicole Cordes <typo3@cordes.co>
parent 317b6da4
......@@ -1048,11 +1048,14 @@ abstract class AbstractItemProvider
}
$foreignTableClause = implode('', $whereClauseParts);
}
// Use pid from parent page clause if in flex flom context
if (strpos($foreignTableClause, '###CURRENT_PID###') !== false
&& !empty($result['flexParentDatabaseRow']['pid'])
) {
$effectivePid = $result['flexParentDatabaseRow']['pid'];
if (strpos($foreignTableClause, '###CURRENT_PID###') !== false) {
// Use pid from parent page clause if in flex form context
if (!empty($result['flexParentDatabaseRow']['pid'])) {
$effectivePid = $result['flexParentDatabaseRow']['pid'];
// Use pid from database row if in inline context
} elseif (!$effectivePid && !empty($result['databaseRow']['pid'])) {
$effectivePid = $result['databaseRow']['pid'];
}
}
$siteRootUid = 0;
......
......@@ -255,6 +255,7 @@ class TcaInline extends AbstractDatabaseRecordProvider implements FormDataProvid
// do extra handling of pageTsConfig merged here. Just provide "parent" pageTS as is
'pageTsConfig' => $result['pageTsConfig'],
'userTsConfig' => $result['userTsConfig'],
'databaseRow' => $result['databaseRow'],
'processedTca' => [
'ctrl' => [],
'columns' => [
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment