Bug #16392
closedPage-TSconfig ###PAGE_TSCONFIG_STR### not evaluated correctly in Backend
100%
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
Updated by Markus Stauffiger about 17 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
Updated by Maryna Sigayeva about 17 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).
Updated by Vladimir Podkovanov about 16 years ago
Hello, is it not fixed yet in releases?
Updated by Anonymous over 14 years ago
@vladimir: no, it's still buggy.
thanks to markus and maryna for the fix!
Updated by Chris topher over 14 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/
Updated by Gerrit Code Review over 11 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
Updated by Gerrit Code Review over 10 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
Updated by Susanne Moog over 10 years ago
- File foobar_0.0.0_201406191851.zip foobar_0.0.0_201406191851.zip added
- Target version deleted (
0) - PHP Version deleted (
5) - Is Regression set to No
Attached test extension.
Updated by Gerrit Code Review over 10 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
Updated by Gerrit Code Review over 10 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
Updated by Wouter Wolters over 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset cf0542c19a1a2f1ce37c435ceee8dbc19379e8cd.