in2code-de / in2publish_core

in2publish Community Version
https://www.in2code.de/produkte/content-publisher/
GNU General Public License v3.0
40 stars 23 forks source link

Exception when foreign_table_where starts with "ORDER …" #113

Closed YKWeyer closed 8 months ago

YKWeyer commented 8 months ago

Some extensions (like georgringer/news, or beechit/fal-securedownload) use foreign_table_where to define ORDER BY …. With the solution introduced in https://github.com/in2code-de/in2publish_core/commit/cf903641854adbdabc2def1542edda9dbc1b3fa6, this would be cut to DER BY …, resulting in a PHP exception.

Uncaught TYPO3 Exception: An exception occurred while executing 'SELECT * FROM `fe_groups` WHERE (`uid` IN (?)) AND (DER BY fe_groups.title) ORDER BY `title` ASC' with params [261]: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'BY fe_groups.title) ORDER BY `title` ASC' at line 1

The stripLogicalOperatorPrefix should modified be edited to ensure there is always at least one space after AND or OR