2 namespace TYPO3\CMS\Install\Updates;
28 protected $title =
'Migrate the Flexform for CType "table" to regular fields in tt_content';
41 'CType=\'table\' AND pi_flexform IS NOT NULL AND deleted = 0'
51 $description =
'The extension "frontend" uses regular database fields in the tt_content table ' .
52 'for the CType "table". Before this was a FlexForm.<br /><br />' .
53 'This update wizard migrates these FlexForms to regular database fields.';
65 public function performUpdate(array &$databaseQueries, &$customMessages)
69 $databaseResult = $databaseConnection->exec_SELECTquery(
72 'CType=\'table\' AND pi_flexform IS NOT NULL AND deleted = 0'
75 while ($tableRecord = $databaseConnection->sql_fetch_assoc($databaseResult)) {
78 if (is_array($flexForm)) {
82 $fields[
'pi_flexform'] = null;
84 $databaseConnection->exec_UPDATEquery(
86 'uid=' . (
int)$tableRecord[
'uid'],
90 $databaseQueries[] = $databaseConnection->debug_lastBuiltQuery;
94 $databaseConnection->sql_free_result($databaseResult);
113 'table_caption' => array(
115 'fieldName' =>
'acctables_caption',
117 'values' =>
'passthrough'
119 'table_delimiter' => array(
120 'sheet' =>
's_parsing',
121 'fieldName' =>
'tableparsing_delimiter',
123 'values' =>
'passthrough'
125 'table_enclosure' => array(
126 'sheet' =>
's_parsing',
127 'fieldName' =>
'tableparsing_quote',
129 'values' =>
'passthrough'
131 'table_header_position' => array(
133 'fieldName' =>
'acctables_headerpos',
140 'table_tfoot' => array(
142 'fieldName' =>
'acctables_tfoot',
144 'values' =>
'passthrough'
148 foreach ($mapping as $fieldName => $configuration) {
149 $flexFormValue = $this->
getFlexFormValue($flexForm, $configuration[
'fieldName'], $configuration[
'sheet']);
151 if ($flexFormValue !==
'') {
152 if ($configuration[
'values'] ===
'passthrough') {
153 $fields[$fieldName] = $flexFormValue;
154 }
elseif (is_array($configuration[
'values'])) {
155 $fields[$fieldName] = $configuration[
'values'][$flexFormValue];
158 $fields[$fieldName] = $configuration[
'default'];
177 if (!is_array($flexForm)) {
193 return $flexForm[
'data'][$sheet][
'lDEF'][$fieldName][
'vDEF'];