Commit 957082fc authored by Oliver Hader's avatar Oliver Hader Committed by Oliver Hader
Browse files

[FOLLOWUP][TASK] Remove column sys_file_reference.sorting

Table sys_file_reference is used as "inline 1:n foreign_field" composite
assiciation and is processed in RelationHandler methods readForeignField
and writeForeignField. Albeit it looks like an MM table it still is a
regular TCA table being used as an entity with further attributes.

That's why this follow-up reverts the changes in file RelationHandler.php
that have been introduced in 728bfc19.

Related: #83160
Releases: master
Change-Id: I4b7a78a0ee494af9492996e81c2b631c29832cc6
Reviewed-on: https://review.typo3.org/55107

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog's avatarSusanne Moog <susanne.moog@typo3.org>
Reviewed-by: Stephan Großberndt's avatarStephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
Tested-by: Oliver Hader's avatarOliver Hader <oliver.hader@typo3.org>
parent f339e8e2
......@@ -556,7 +556,7 @@ class RelationHandler
// Default
$uidLocal_field = 'uid_local';
$uidForeign_field = 'uid_foreign';
$sorting_field = $tableName === 'sys_file_reference' ? '' : 'sorting';
$sorting_field = 'sorting';
}
if ($this->MM_table_where) {
$queryBuilder->andWhere(
......@@ -574,9 +574,7 @@ class RelationHandler
$queryBuilder->createNamedParameter((int)$uid, \PDO::PARAM_INT)
)
);
if (!empty($sorting_field)) {
$queryBuilder->orderBy($sorting_field);
}
$queryBuilder->orderBy($sorting_field);
$statement = $queryBuilder->execute();
while ($row = $statement->fetch()) {
// Default
......@@ -618,7 +616,7 @@ class RelationHandler
// default
$uidLocal_field = 'uid_local';
$uidForeign_field = 'uid_foreign';
$sorting_field = $MM_tableName === 'sys_file_reference' ? '' : 'sorting';
$sorting_field = 'sorting';
}
// If there are tables...
$tableC = count($this->tableArray);
......@@ -654,10 +652,9 @@ class RelationHandler
->where($queryBuilder->expr()->eq(
$uidLocal_field,
$queryBuilder->createNamedParameter($uid, \PDO::PARAM_INT)
));
if (!empty($sorting_field)) {
$queryBuilder->orderBy($sorting_field);
}
))
->orderBy($sorting_field);
if ($prep) {
$queryBuilder->addSelect('tablenames');
}
......@@ -754,9 +751,7 @@ class RelationHandler
$insertFields = $this->MM_insert_fields;
$insertFields[$uidLocal_field] = $uid;
$insertFields[$uidForeign_field] = $val['id'];
if (!empty($sorting_field)) {
$insertFields[$sorting_field] = $c;
}
$insertFields[$sorting_field] = $c;
if ($tablename) {
$insertFields['tablenames'] = $tablename;
$insertFields = $this->completeOppositeUsageValues($tablename, $insertFields);
......
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