#68489TCA type:select foreign_table_where -> readOnly not working
Description
###
'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
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 3
History 9
-
Susanne Moog commented and changed description status
NewNeeds Feedback 07/24/15, 11:07 -
d.ros no-lastname-given commented and changed attached Auswahl_324.png attached Auswahl_325.png attached Auswahl_326.png 07/24/15, 12:02
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 -
d.ros no-lastname-given commented 07/24/15, 12:11
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
-
Susanne Moog commented and changed description 07/25/15, 20:50
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
-
d.ros no-lastname-given commented 07/25/15, 21:15
Hi Susi,
as I said: “If not, it should be a new feature”. Because I see this as a relative common demand.
Cheers
-
Alexander Opitz commented and changed tracker
BugFeature statusNeeds FeedbackNew target version 10/27/15, 14:46Changed to feature.
-
Riccardo De Contardi changed target version 02/23/17, 14:39
-
Susanne Moog changed target version 01/28/18, 14:28
-
Georg Ringer commented and changed status
NewClosed 06/26/24, 07:26hey,
I don’t see currently a need for that and TBH don’t fully understand the issue. closing as part of forge cleanup.
if you don’t agree, feel free to contact me via slack!
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