Bug #16392

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

Added by Oliver Hader about 13 years ago. Updated 12 months ago.

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

100%

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)

be_select_error.png View (21 KB) Administrator Admin, 2006-07-21 14:47

class.ux_t3lib_transferdata.php View (2.12 KB) Administrator Admin, 2007-11-05 00:27

foobar_0.0.0_201406191851.zip (512 KB) 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 clause Closed 2011-09-27
Related to TYPO3 Core - Bug #50785: FlexForm does not substitute markers in foreign_table_where Closed 2013-08-05

Associated revisions

Revision 03f60caa (diff)
Added by Xavier Perseguers almost 9 years ago

Fixed bug #16392: Install tool cannot compare "ENGINE" of MySQL Tables when DBAL is active

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/trunk@40420 735d13b6-9817-0410-8766-e36946ffe9aa

Revision 3622f281 (diff)
Added by Xavier Perseguers almost 9 years ago

Backported changeset 40420 from trunk: Fixed bug #16392

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/branches/DBAL_1-1@40421 735d13b6-9817-0410-8766-e36946ffe9aa

Revision e0f5bbdb (diff)
Added by Xavier Perseguers almost 9 years ago

Backported changeset 40420 from trunk: Fixed bug #16392

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/branches/DBAL_1-0@40422 735d13b6-9817-0410-8766-e36946ffe9aa

Revision 9cf22db9 (diff)
Added by Xavier Perseguers almost 9 years ago

Follow-up for bug #16392: Native tables could not be retrieved anymore

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/trunk@40701 735d13b6-9817-0410-8766-e36946ffe9aa

Revision 0156d7c8 (diff)
Added by Xavier Perseguers almost 9 years ago

Backported changeset 40701 from trunk: Follow-up for bug #16392

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/branches/DBAL_1-1@40702 735d13b6-9817-0410-8766-e36946ffe9aa

Revision 94e7cbbc (diff)
Added by Xavier Perseguers almost 9 years ago

Backported changeset 40701 from trunk: Follow-up for bug #16392

git-svn-id: https://svn.typo3.org/TYPO3v4/Extensions/dbal/branches/DBAL_1-0@40703 735d13b6-9817-0410-8766-e36946ffe9aa

Revision 0ad6a321 (diff)
Added by Wouter Wolters about 5 years ago

[BUGFIX] Page-TSconfig ###PAGE_TSCONFIG_STR### not evaluated correctly

Page-TSconfig ###PAGE_TSCONFIG_STR### not evaluated
correctly in the backend.

Change-Id: Ieda08a1df71117b5ac90f2c68260f5171570ff63
Resolves: #16392
Releases: 6.3, 6.2
Reviewed-on: https://review.typo3.org/20901
Reviewed-by: Markus Klein
Tested-by: Markus Klein

Revision cf0542c1 (diff)
Added by Wouter Wolters about 5 years ago

[BUGFIX] Page-TSconfig ###PAGE_TSCONFIG_STR### not evaluated correctly

Page-TSconfig ###PAGE_TSCONFIG_STR### not evaluated
correctly in the backend.

Change-Id: Ieda08a1df71117b5ac90f2c68260f5171570ff63
Resolves: #16392
Releases: 6.3, 6.2
Reviewed-on: https://review.typo3.org/31387
Reviewed-by: Markus Klein
Tested-by: Markus Klein

History

#1 Updated by Markus Stauffiger almost 12 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 almost 12 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 almost 11 years ago

Hello, is it not fixed yet in releases?

#4 Updated by Philipp Kitzberger over 9 years ago

@vladimir: no, it's still buggy.

thanks to markus and maryna for the fix!

#5 Updated by Chris topher over 9 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 over 6 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 about 5 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 about 5 years ago

Attached test extension.

#9 Updated by Gerrit Code Review about 5 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 about 5 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 about 5 years ago

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

#12 Updated by Benni Mack 12 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF