Project

General

Profile

Actions

Bug #49125

closed

makeCategorization - category

Added by daniel no-lastname-given about 11 years ago. Updated about 10 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Categorization API
Target version:
-
Start date:
2013-06-14
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
6.1
PHP Version:
5.3
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

Hi i have the following issue:

it is written in the description for the new feature category:

$categoryUid = 1;
$tableName = 'tt_content';
$collection = \TYPO3\CMS\Core\Category\Collection\CategoryCollection::load(
$categoryUid, # Populates the entries directly on load, might be bad for memory on large collections
TRUE,
$tableName
);

But if i just want to get the entrys for the tt_content table, it doesn't work.

For example if i have the following entries:

entry 1: tt_content table
entry 2: tx_myownextension table

in my category (mycategory).

if i would like to have only the entries from the tt_content table it doesnt work because it shows all the entries - in total 2. Isn't that wrong? It only has to show the entry for the tt_content table?

I figured out that the sql statement in typo3\sysext\core\Classes\Category\Collection\Category\CategoryCollection.php in line 110:
$resource = $this->getDatabase()->exec_SELECT_mm_query($this->getItemTableName() . '.*', self::$storageTableName, 'sys_category_record_mm', $this->getItemTableName(), 'AND ' . self::$storageTableName . '.uid=' . intval($this->getIdentifier()));
doesn't use the column given by parameter $tableName. so i changed it to:
$resource = $this->getDatabase()->exec_SELECT_mm_query($this->getItemTableName() . '.*', self::$storageTableName, 'sys_category_record_mm', $this->getItemTableName(), "AND tablenames = '".$this->getItemTableName()."' ".'AND ' . self::$storageTableName . '.uid=' . intval($this->getIdentifier()));
and now it works. is that correct or did you have other plans with $tableName ??

greetz
daniel

Actions

Also available in: Atom PDF