Issue Bug Closed

#45332category api won't work when used with multiple tables

Thomas Allmer 02/09/13, 23:47 updated 10/02/18, 12:15

Description

if you have tableA, and tableB both using the category api the function
\TYPO3\CMS\Core\Category\Collection\CategoryCollection::load(…)
will return wrong results

example:
tableA has an element A1, A2, A3
tableB has an element B1, B2, B3

A1 is in the category c1
B2 is in the category c1
B3 is in the category c1

now if you use the function to get c1 of tableA it will give u A1, A2, A3 even though ONLY A1 is in the category… (as it will also get B2, B3 and as the id element is also available for tableA it shows them..

the function getCollectedRecords only checks for uid and not for the tablename
the solution is simple… just add a
“AND sys_category_record_mm.tablenames = <table_to_display>“</table_to_display>

Reviews 3