Bug #16392

Page-TSconfig ###PAGE_TSCONFIG_STR### not evaluated correctly in Backend

Added by Oliver Hader almost 15 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
-
Start date:
2006-07-21
Due date:
% Done:

100%

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

Description

A plugin on Web>Page, that is normally stored in tt_content, is configurable by a flexform. That flexform has a paragraph, using a select-type to get data from a foreign table.

The flexform-configuration on that is a bit special:
<config>
<type>select</type>
<foreign_table>tx_ohhotels_hotel</foreign_table>
<foreign_table_where>
AND pages.pid = ###PAGE_TSCONFIG_ID###
AND ('###PAGE_TSCONFIG_STR###' = '-' OR tx_ohhotels_hotel.exthotel REGEXP '(^|,)###PAGE_TSCONFIG_STR###(,|$)')
ORDER BY tx_ohhotels_hotel.title
</foreign_table_where>
<size>15</size>
<minitems>0</minitems>
<maxitems>500</maxitems>
</config>

And on Page-TSconfig we have:
TCEFORM.tt_content.pi_flexform.PAGE_TSCONFIG_ID = 474
TCEFORM.tt_content.pi_flexform.PAGE_TSCONFIG_STR = 1

If you have a look to the image attached, you can see, that the "Items" on the right side are shown correctly. But if chose some of the available items, save and reload the page, this selected items should be visible under "Selected:" - but here they are not!

To get more in detail, here are the performed SQL-queries (depending on the flexform-structure above):

1) This is a WRONG query, trying to get the selected-fields:
SELECT tx_ohhotels_hotel.uid,tx_ohhotels_hotel.title,tx_ohhotels_hotel.hidden
FROM tx_ohhotels_hotel,pages
WHERE pages.uid=tx_ohhotels_hotel.pid
AND pages.deleted=0 AND tx_ohhotels_hotel.deleted=0 AND 1=1
AND pages.pid = 0
AND ('' = '-' OR tx_ohhotels_hotel.exthotel REGEXP '(^|,)(,|$)')
ORDER BY tx_ohhotels_hotel.title

If you compare this query to the flexform-configuration, you can see, that the ###PAGE_TSCONFIG_STR### and ###PAGE_TSCONFIG_ID### are not correctly replaced by the configured values in Page-TSconfig.

2) And this is the correct query, used to get the items on the right side:
SELECT tx_ohhotels_hotel.uid,tx_ohhotels_hotel.title,tx_ohhotels_hotel.hidden
FROM tx_ohhotels_hotel,pages
WHERE pages.uid=tx_ohhotels_hotel.pid
AND pages.deleted=0 AND tx_ohhotels_hotel.deleted=0 AND 1=1
AND pages.pid = 474
AND ('1' = '-' OR tx_ohhotels_hotel.exthotel REGEXP '(^|,)1(,|$)')
ORDER BY tx_ohhotels_hotel.title

I think the queries for rendering the "Items:" and the "Selected:" part (as shown in the image) are composed differently. For "Selected:" the marker substituion is missing.

(issue imported from #M3906)


Files

be_select_error.png (21 KB) be_select_error.png Administrator Admin, 2006-07-21 14:47
class.ux_t3lib_transferdata.php (2.12 KB) class.ux_t3lib_transferdata.php Administrator Admin, 2007-11-05 00:27
foobar_0.0.0_201406191851.zip (512 KB) foobar_0.0.0_201406191851.zip Susanne Moog, 2014-06-19 18:52

Related issues

Related to TYPO3 Core - Bug #30354: FlexForm select fields can't replace makers in their foreign_table_where clauseClosed2011-09-27

Actions
Related to TYPO3 Core - Bug #50785: FlexForm does not substitute markers in foreign_table_whereClosed2013-08-05

Actions
#1

Updated by Markus Stauffiger over 13 years ago

After hours of searching the t3lib classes I think I found the source of the bug:

class.t3lib_transferdata.php, Line 655

// Process value:
$dataValues[$key][$vKey] = $this->renderRecord_SW($dataValues[$key][$vKey],$dsConf['TCEforms'],$CVTSconfig,$CVtable,$CVrow,'');

The last parameter of this call is supposed to be "pi_flexform", not empty.

Can anybody confirm this solution?

Best regards
Markus

#2

Updated by Maryna Sigayeva over 13 years ago

Hi,

I can confirm that your fix helped me.

Please find the ux_t3lib_transferData class for everybody's convenience attached (until it's fixed in the distribution).

#3

Updated by Vladimir Podkovanov over 12 years ago

Hello, is it not fixed yet in releases?

#4

Updated by Philipp Kitzberger over 11 years ago

@vladimir: no, it's still buggy.

thanks to markus and maryna for the fix!

#5

Updated by Chris topher about 11 years ago

If someone wants this fix included in the next releases, send Maryna's patch to the Core List.
Check out http://typo3.org/teams/core/core-mailinglist-rules/

#6

Updated by Gerrit Code Review about 8 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master has been pushed to the review server.
It is available at https://review.typo3.org/20901

#7

Updated by Gerrit Code Review almost 7 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/20901

#8

Updated by Susanne Moog almost 7 years ago

Attached test extension.

#9

Updated by Gerrit Code Review almost 7 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/20901

#10

Updated by Gerrit Code Review almost 7 years ago

Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/31387

#11

Updated by Wouter Wolters almost 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
#12

Updated by Benni Mack over 2 years ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF