Project

General

Profile

Actions

Bug #53712

closed

Invalid refindex data for file relations

Added by Alexander Stehlik about 11 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
DataHandler aka TCEmain
Target version:
-
Start date:
2013-11-17
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
easy
Is Regression:
No
Sprint Focus:

Description

Currently the getRelations_procDB method in the ReferenceIndex generates invalid data for sys_file_reference relations.

First it will always return a non empty array, even if no relations are found. This will lead to a lot of senseless refindex entries that have no related records. (found this out after applying patch from https://review.typo3.org/25422/).

The second problem is, that the the id entry in the resulting array will contain an array again, and not the UID of the file as expected. This leads to a query that tries to insert an array in the sys_refindex table which will result in a PHP Warning.

Finally the structure of the resulting array is invalid, because all entries will added beneath the zero index of a parent array that is not needed:

array(1) {
  [0] =>
  array(2) {
    [0] =>
    array(2) {
      'table' =>
      string(8) "sys_file" 
      'id' =>
      int(123)
    }
    [1] =>
    array(2) {
      'table' =>
      string(8) "sys_file" 
      'id' =>
      int(1234)
    }
  }
}

The correct array structure would look like this (without the parent array):

array(2) {
  [0] =>
  array(2) {
    'table' =>
    string(8) "sys_file" 
    'id' =>
    int(123)
  }
  [1] =>
  array(2) {
    'table' =>
    string(8) "sys_file" 
    'id' =>
    int(1234)
  }
}

Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #53713: Reference index ignores sys_file_reference deleted flagClosed2013-11-17

Actions
Actions

Also available in: Atom PDF