Issue Bug Closed

#40816Livesearch fails when TCA setting 'sortby' exists but is empty

Loek Hilgersom 09/11/12, 12:21 updated 10/23/17, 22:12

Description

Livesearch fails with an ExtDirect SQL error if a searchable table contains a TCA setting for sortby like this:

TCA['tablename']['ctrl']['sortby'] = '';

This happens e.g. with tx_news:

'sortby' => ($configuration->getManualSorting() ? 'sorting' : '')

Livesearch adds an empty ‘ ORDER BY ‘ to the query and throws an SQL error.

Fix:
LiveSearch::makeOrderByTable() should not just check if ‘sortby’ key exists in TCA, but also check if the containing string is not empty (strlen>0).

I’ll post the patch to gerrit a.s.a.p.

Reviews 0

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