Issue Bug Closed

#49125makeCategorization - category

daniel no-lastname-given 06/14/13, 12:55 updated 06/02/14, 16:48

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

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.