-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #435 from t3solution/5.3.21
See release notes at https://www.t3sbootstrap.de/log
- Loading branch information
Showing
90 changed files
with
3,397 additions
and
436 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace T3SBS\T3sbootstrap\Command; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\Console\Command\Command; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Core\Database\ConnectionPool; | ||
use TYPO3\CMS\Core\Database\Connection; | ||
|
||
/* | ||
* This file is part of the TYPO3 extension t3sbootstrap. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
class ImageToTextmedia extends CommandBase | ||
{ | ||
/** | ||
* Defines the allowed options for this command | ||
* | ||
* @inheritdoc | ||
*/ | ||
protected function configure() | ||
{ | ||
$this->setDescription('Migrate CType image to textmedia'); | ||
} | ||
|
||
|
||
/** | ||
* Update all records | ||
* | ||
* @inheritdoc | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); | ||
$contentQueryBuilder = $connectionPool->getQueryBuilderForTable('tt_content'); | ||
$images = $contentQueryBuilder | ||
->select('uid', 'image') | ||
->from('tt_content') | ||
->where( | ||
$contentQueryBuilder->expr()->eq('CType', $contentQueryBuilder->createNamedParameter('image')) | ||
) | ||
->executeQuery() | ||
->fetchAllAssociative(); | ||
|
||
$sysfileQueryBuilder = $connectionPool->getQueryBuilderForTable('sys_file_reference'); | ||
|
||
foreach ($images as $image) { | ||
|
||
$contentQueryBuilder | ||
->update('tt_content') | ||
->where( | ||
$contentQueryBuilder->expr()->eq('uid', $contentQueryBuilder->createNamedParameter($image['uid'], Connection::PARAM_INT)), | ||
) | ||
->set('assets', $image['image']) | ||
->set('image', 0) | ||
->set('CType', 'textmedia') | ||
->executeStatement(); | ||
|
||
$sysfileQueryBuilder | ||
->update('sys_file_reference') | ||
->where( | ||
$sysfileQueryBuilder->expr()->eq('uid_foreign', $sysfileQueryBuilder->createNamedParameter($image['uid'], Connection::PARAM_INT)), | ||
) | ||
->set('fieldname', 'assets') | ||
->executeStatement(); | ||
} | ||
|
||
return Command::SUCCESS; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace T3SBS\T3sbootstrap\Command; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\Console\Command\Command; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Core\Database\ConnectionPool; | ||
use TYPO3\CMS\Core\Database\Connection; | ||
|
||
/* | ||
* This file is part of the TYPO3 extension t3sbootstrap. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
class TextToTextmedia extends CommandBase | ||
{ | ||
/** | ||
* Defines the allowed options for this command | ||
* | ||
* @inheritdoc | ||
*/ | ||
protected function configure() | ||
{ | ||
$this->setDescription('Migrate CType text to textmedia'); | ||
} | ||
|
||
|
||
/** | ||
* Update all records | ||
* | ||
* @inheritdoc | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); | ||
$contentQueryBuilder = $connectionPool->getQueryBuilderForTable('tt_content'); | ||
$texts = $contentQueryBuilder | ||
->select('uid',) | ||
->from('tt_content') | ||
->where( | ||
$contentQueryBuilder->expr()->eq('CType', $contentQueryBuilder->createNamedParameter('text')) | ||
) | ||
->executeQuery() | ||
->fetchAllAssociative(); | ||
|
||
|
||
foreach ($texts as $text) { | ||
|
||
$contentQueryBuilder | ||
->update('tt_content') | ||
->where( | ||
$contentQueryBuilder->expr()->eq('uid', $contentQueryBuilder->createNamedParameter($text['uid'], Connection::PARAM_INT)), | ||
) | ||
->set('CType', 'textmedia') | ||
->executeStatement(); | ||
} | ||
|
||
return Command::SUCCESS; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace T3SBS\T3sbootstrap\Command; | ||
|
||
use Symfony\Component\Console\Input\InputInterface; | ||
use Symfony\Component\Console\Output\OutputInterface; | ||
use Symfony\Component\Console\Command\Command; | ||
use TYPO3\CMS\Core\Utility\GeneralUtility; | ||
use TYPO3\CMS\Core\Database\ConnectionPool; | ||
use TYPO3\CMS\Core\Database\Connection; | ||
|
||
/* | ||
* This file is part of the TYPO3 extension t3sbootstrap. | ||
* | ||
* For the full copyright and license information, please read the | ||
* LICENSE file that was distributed with this source code. | ||
*/ | ||
class TextpicToTextmedia extends CommandBase | ||
{ | ||
/** | ||
* Defines the allowed options for this command | ||
* | ||
* @inheritdoc | ||
*/ | ||
protected function configure() | ||
{ | ||
$this->setDescription('Migrate CType textpic to textmedia'); | ||
} | ||
|
||
|
||
/** | ||
* Update all records | ||
* | ||
* @inheritdoc | ||
*/ | ||
protected function execute(InputInterface $input, OutputInterface $output): int | ||
{ | ||
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); | ||
$contentQueryBuilder = $connectionPool->getQueryBuilderForTable('tt_content'); | ||
$textpics = $contentQueryBuilder | ||
->select('uid', 'image') | ||
->from('tt_content') | ||
->where( | ||
$contentQueryBuilder->expr()->eq('CType', $contentQueryBuilder->createNamedParameter('textpic')) | ||
) | ||
->executeQuery() | ||
->fetchAllAssociative(); | ||
|
||
$sysfileQueryBuilder = $connectionPool->getQueryBuilderForTable('sys_file_reference'); | ||
|
||
foreach ($textpics as $textpic) { | ||
|
||
$contentQueryBuilder | ||
->update('tt_content') | ||
->where( | ||
$contentQueryBuilder->expr()->eq('uid', $contentQueryBuilder->createNamedParameter($textpic['uid'], Connection::PARAM_INT)), | ||
) | ||
->set('assets', $textpic['image']) | ||
->set('image', 0) | ||
->set('CType', 'textmedia') | ||
->executeStatement(); | ||
|
||
$sysfileQueryBuilder | ||
->update('sys_file_reference') | ||
->where( | ||
$sysfileQueryBuilder->expr()->eq('uid_foreign', $sysfileQueryBuilder->createNamedParameter($textpic['uid'], Connection::PARAM_INT)), | ||
) | ||
->set('fieldname', 'assets') | ||
->executeStatement(); | ||
} | ||
|
||
return Command::SUCCESS; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.