31 return 'sectionFrameToFrameClassUpdate';
39 return 'Migrate the field "section_frame" for all content elements to "frame_class"';
47 return 'Section frames were used to control the wrapping of each content element in the frontend '
48 .
'output, stored as integers in the database. To get rid of a nessesary mapping of those values we '
49 .
'are now storing strings you can easily adjust that will simply passed to the rendering.';
59 $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable(
'tt_content');
60 $tableColumns = $connection->getSchemaManager()->listTableColumns(
'tt_content');
62 if (!isset($tableColumns[
'section_frame'])) {
65 $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class)->getQueryBuilderForTable(
'tt_content');
66 $queryBuilder->getRestrictions()->removeAll();
67 $elementCount = $queryBuilder->count(
'uid')
70 $queryBuilder->expr()->gt(
'section_frame', 0)
74 return (
bool)$elementCount;
83 DatabaseUpdatedPrerequisite::class
94 $connection = GeneralUtility::makeInstance(ConnectionPool::class)->getConnectionForTable(
'tt_content');
95 $queryBuilder = $connection->createQueryBuilder();
96 $queryBuilder->getRestrictions()->removeAll();
97 $statement = $queryBuilder->select(
'uid',
'section_frame')
100 $queryBuilder->expr()->gt(
'section_frame', 0)
103 while ($record = $statement->fetch()) {
104 $queryBuilder = $connection->createQueryBuilder();
105 $queryBuilder->update(
'tt_content')
107 $queryBuilder->expr()->eq(
109 $queryBuilder->createNamedParameter($record[
'uid'], \PDO::PARAM_INT)
112 ->set(
'section_frame', 0,
false)
114 $queryBuilder->execute();
133 12 =>
'indent-right',
136 if (array_key_exists($sectionFrame, $mapping)) {
137 return $mapping[$sectionFrame];
139 return 'custom-' . (int)$sectionFrame;