lochmueller / calendarize

📆 Best TYPO3 Calendar ever 📆
http://typo3.org/extensions/repository/view/calendarize
75 stars 84 forks source link

Error in Search plugin when no categories in use #790

Closed biedert closed 4 months ago

biedert commented 4 months ago

If no event entry in the storage folder has a sys_category assigned, the following Exception is thrown in the Search Plugin:

(1/1) #1484828466 TYPO3\CMS\Extbase\Persistence\Generic\Storage\Exception\BadConstraintException
The IN operator needs a non-empty value list to compare against. The given value list is empty.](url)

This is because the method getCategories in Classes/EventListener/CategoryFilterEventListener.php tries to find categories by an empty array. A quick fix would be to add

if(!$categoryIds) {
    return [];
}

after line 70 in that file. Tested in v13.0.2 in TYPO3 12.4

lochmueller commented 4 months ago

Hey @biedert , thanks for the reporting. Fixed in current master branch. Regards, Tim