Project

General

Profile

Actions

Bug #77869

closed

TYPO3 8.3: Wrong sql with FlexForm with a select and foreign_table_where with an order by

Added by Alex Kellner about 8 years ago. Updated about 8 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2016-09-06
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

This issue is related to #77868

In powermail there is a FlexForm that renders a select field with some records. Up to T3 8.2 it was possible to change the ordering with "foreign_table_where". Now an error comes up. A simple FlexForm configuration could be:

<TCEforms>
    <label>Something</label>
    <config>
        <type>select</type>
        <renderType>selectSingle</renderType>
        <items type="array">

        </items>
        <size>1</size>
        <minitems>1</minitems>
        <maxitems>1</maxitems>
        <foreign_table>tx_powermail_domain_model_form</foreign_table>
        <foreign_table_where>AND tx_powermail_domain_model_form.deleted = 0
            AND tx_powermail_domain_model_form.hidden = 0
            AND tx_powermail_domain_model_form.sys_language_uid IN (-1,0)
            order by tx_powermail_domain_model_form.title</foreign_table_where>
    </config>
</TCEforms>

This leads to:

An exception occurred while executing 'SELECT `tx_powermail_domain_model_form`.`uid`, `tx_powermail_domain_model_form`.`title`, `tx_powermail_domain_model_form`.`t3ver_id`, `tx_powermail_domain_model_form`.`t3ver_state`, `tx_powermail_domain_model_form`.`t3ver_wsid`, `tx_powermail_domain_model_form`.`t3ver_count`, `tx_powermail_domain_model_form`.`hidden`, `tx_powermail_domain_model_form`.`starttime`, `tx_powermail_domain_model_form`.`endtime` FROM `tx_powermail_domain_model_form`, `pages` WHERE (tx_powermail_domain_model_form.deleted = 0 AND tx_powermail_domain_model_form.hidden = 0 AND tx_powermail_domain_model_form.sys_language_uid IN (-1,0) order by tx_powermail_domain_model_form.title) AND ( 1=1) AND (`pages`.`uid` = `tx_powermail_domain_model_form`.`pid`) AND ((`tx_powermail_domain_model_form`.`deleted` = 0) AND (`pages`.`deleted` = 0))': You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'order by tx_powermail_domain_model_form.title) AND ( 1=1) AND (`pages`.`uid` = `' at line 4

My first thought were that there is an extra configuration for sorting, but the documentation says foreign_table_where is still ok for sorting: https://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Select/Index.html#foreign-table-where

Am I wrong or is this a small bug?

Actions #1

Updated by Alex Kellner about 8 years ago

  • Description updated (diff)

Sorry, please close this issue - I think this is my mistake. Breaks seems not allowed any more in the foreign_table_where statement.

Actions #2

Updated by Georg Ringer about 8 years ago

@morton: can you decide what to do with that? thanks

Actions #3

Updated by Georg Ringer about 8 years ago

  • Status changed from New to Closed

Closed as requested

Actions

Also available in: Atom PDF