FriendsOfTYPO3 / compatibility6

Allow TYPO3 CMS 7 installations deal with compatibility problems while upgrading from v6.2 to v7
18 stars 11 forks source link

Using flexParentDatabaseRow in userFunc or itemsProcFunc does not work with compatibility6 #15

Closed sypets closed 6 years ago

sypets commented 7 years ago

Problem description

The breaking change no 70132 ("FormEngine custom functions") in the TYPO3 core 7.6 suggests using 'flexParentDatabaseRow' instead of 'row' for retrieving the full parent database row in a userFunc / itemsProcFunc.

https://wiki.typo3.org/TYPO3.CMS/Releases/7.6/Breaking#Breaking:_.2370132_-_FormEngine_custom_functions

This will not work, if compatibility6 is installed.

Reproduce

  1. Use current 7.6 installation (e.g. introduction package)
  2. Install compatibility6
  3. Install current tt_address version 4.0.0 as an example (any other extension which uses this functionality will reproduce the same results)
  4. Create an address plugin content
  5. Add tt_address static includes and for example the following typoscript
plugin.tx_ttaddress_pi1 {
    templatePath = fileadmin/template/ext/tt_address/
    defaultTemplateFileName = default_hcard.htm
 }
  1. Create several template files to choose from, e.g.
mkdir -p fileadmin/template/ext/tt_address/
cp typo3conf/ext/tt_address/res/default_hcard.htm fileadmin/template/ext/tt_address/
cp typo3conf/ext/tt_address/res/default_hcard.htm  fileadmin/template/ext/tt_address/default_hcard2.htm
  1. Edit the address plugin and click on "Plugin option" : "Display" : "Template"

Expected result

A dropdown list should appear with the 2 available files.

Actual result

Only default item in list displayed.

Confirm

Deinstall compatibility6 and try again

Reason for problem

https://github.com/FriendsOfTYPO3/tt_address/blob/60eed630ee66663e63422f9f89949bb5896e4731/Classes/Hooks/Tca/AddFilesToSelector.php#L41

$params['flexParentDatabaseRow']['pid'] will be empty. The same problem appears in other extensions if they use the same mechanism.