Project

General

Profile

Actions

Feature #68489

open

TCA type:select foreign_table_where -> readOnly not working

Added by d.ros no-lastname-given almost 9 years ago. Updated over 6 years ago.

Status:
New
Priority:
Must have
Assignee:
-
Category:
Backend API
Target version:
-
Start date:
2015-07-23
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.5
Tags:
Complexity:
Sprint Focus:

Description


  1. 'foo' => array(
            'exclude' => 1,
            'label' => 'bar',
            'config' => array(
                'type' => 'select',
                'foreign_table' => 'tx_foo',
                'foreign_field' => 'tx_bar',
                'size' => 4,
                'minitems' => 0,
                'maxitems' => 20,
                            'readOnly' => 1
            )
        ),
    
    ###

Above listing gives back a list of Items in backend set to read only. Unfortunately does the query not match my case. So I set a foreign_table_where like this:

###

'foo' => array(
        'exclude' => 1,
        'label' => 'bar',
        'config' => array(
            'type' => 'select',
            'foreign_table' => 'tx_foo',
            'foreign_table_where' => 'AND FIND_IN_SET(\'###THIS_UID###\',tx_bar)',
            'size' => 4,
            'minitems' => 0,
            'maxitems' => 20,
                        'readOnly' => 1
        )
    ),
###

Now I only see an empty select field. If I remove the "readOnly" I can see the queried Items on the right side of the select boxes. But I do not want to select them individually.

I assume that this is a bug. If not it should be a new feature. I did not find any other solution to this problem.

Cheers,

david


Files

Auswahl_324.png (18.5 KB) Auswahl_324.png d.ros no-lastname-given, 2015-07-24 12:02
Auswahl_325.png (28 KB) Auswahl_325.png d.ros no-lastname-given, 2015-07-24 12:02
Auswahl_326.png (12.2 KB) Auswahl_326.png d.ros no-lastname-given, 2015-07-24 12:02
Actions #1

Updated by Susanne Moog almost 9 years ago

  • Description updated (diff)
  • Status changed from New to Needs Feedback

Hi,

after adding readOnly only things that were already selected are displayed in the select box and that holds true no matter if you are using foreign_field or foreign_table_where.

I just tested both variants with the following results:
- foreign_field without readonly
--> selectable list of items on the right, none on the left

- foreign_table_where without readonly
--> selectable list of items on the right, none on the left

- foreign_field with readonly, without pre-selected items
--> empty readonly select field

- foreign_table_where with readonly, without pre-selected items
--> empty readonly select field

- foreign_field with readonly, selected some items before readonly was set
--> readonly list of previous selected items

- foreign_table_where with readonly, selected some items before readonly was set
--> readonly list of previous selected items

As far as I can tell there is no bug here. Can you describe in more detail where you think the bug is?

Thanks,

Susi

Updated by d.ros no-lastname-given almost 9 years ago

Hello Susi,

thank you for your effort. In a live project I do have the circumstance as described. See the screenshots.

BTW: It is neccessary that you did not fill the field by selecting items if you use the readonly thing.

If you need more info to understand this case, so let me know.

Cheers
David

Actions #3

Updated by d.ros no-lastname-given almost 9 years ago

In the end it would make sense to have the option if readOnly is set to choose if the queried elements shall be preselected or not. Especially if you run a foreign_table_where

The usecase here is from an editor POV:

- show related items within fe_users BE and FE which have a relation set within news extension without touching anything

Actions #4

Updated by Susanne Moog almost 9 years ago

  • Description updated (diff)

Hi David,

so, let me see if I got it right. What you want to do is show the results of a query as readOnly select box? You don't really want something "selectable" but want to display the result of a custom query purely as information for the user?

If so, then this is more a missing feature than a bug as select fields are meant to show "things to select" and "selected things" and in your case you are trying to show selected things without prior selection.

To address the problem in your project you probably have to use type=user and query the items yourself to get the behavior you want, sorry :/

If you have any further problems feel free to also join us on slack (typo3.slack.com).

Susi

Actions #5

Updated by d.ros no-lastname-given almost 9 years ago

Hi Susi,

as I said: "If not, it should be a new feature". Because I see this as a relative common demand.

Cheers

Actions #6

Updated by Alexander Opitz over 8 years ago

  • Tracker changed from Bug to Feature
  • Status changed from Needs Feedback to New
  • Target version set to 8 LTS

Changed to feature.

Actions #7

Updated by Riccardo De Contardi about 7 years ago

  • Target version changed from 8 LTS to 9.0
Actions #8

Updated by Susanne Moog over 6 years ago

  • Target version deleted (9.0)
Actions

Also available in: Atom PDF