Skip to content
Snippets Groups Projects
Commit ae09e012 authored by Torsten Oppermann's avatar Torsten Oppermann
Browse files

[TASK] Add pid as command controller param

parent 5c2c25ed
No related branches found
No related tags found
1 merge request!6Feature news migration
...@@ -101,6 +101,7 @@ class MigrateNewsCommandController extends CommandController { ...@@ -101,6 +101,7 @@ class MigrateNewsCommandController extends CommandController {
* @param int $year only news from that year will be migrated * @param int $year only news from that year will be migrated
* @param string $languageMapAsJson a json, mapping language ids (old => new). this is needed if the sys_language_uids have changed * @param string $languageMapAsJson a json, mapping language ids (old => new). this is needed if the sys_language_uids have changed
* @param string $categoryMapAsJson a json, mapping sys_category ids (old => new). t * @param string $categoryMapAsJson a json, mapping sys_category ids (old => new). t
* @param $pId $year only news from that year will be migrated
* *
* @throws IllegalObjectTypeException * @throws IllegalObjectTypeException
* @throws UnknownObjectException * @throws UnknownObjectException
...@@ -109,7 +110,8 @@ class MigrateNewsCommandController extends CommandController { ...@@ -109,7 +110,8 @@ class MigrateNewsCommandController extends CommandController {
public function runMigrateNewsCommand( public function runMigrateNewsCommand(
$copyPageId, $categoryPid, $year = 2015, $copyPageId, $categoryPid, $year = 2015,
$languageMapAsJson = '{"3":1,"1":0,"2":2,"0":3}', $languageMapAsJson = '{"3":1,"1":0,"2":2,"0":3}',
$categoryMapAsJson = '{"2":10,"3":11,"4":12,"5":13,"6":14,"7":15,"8":16,"9":17}' $categoryMapAsJson = '{"2":10,"3":11,"4":12,"5":13,"6":14,"7":15,"8":16,"9":17}',
$pId = 52
) { ) {
// fix repair translation bug where tsfee is missing from command controller, can be removed when v1.5 is released // fix repair translation bug where tsfee is missing from command controller, can be removed when v1.5 is released
if (!$GLOBALS['TSFE']) { if (!$GLOBALS['TSFE']) {
...@@ -124,7 +126,7 @@ class MigrateNewsCommandController extends CommandController { ...@@ -124,7 +126,7 @@ class MigrateNewsCommandController extends CommandController {
/** @var DatabaseConnection $db */ /** @var DatabaseConnection $db */
$db = $GLOBALS['TYPO3_DB']; $db = $GLOBALS['TYPO3_DB'];
$where = 'hidden = 0 and deleted = 0 and endtime = 0 and pid = 52'; $where = 'hidden = 0 and deleted = 0 and endtime = 0 and pid = ' . (int) $pId;
/** @var \mysqli_result $result */ /** @var \mysqli_result $result */
$result = $db->exec_SELECTquery('*', 'tx_news_domain_model_news', $where); $result = $db->exec_SELECTquery('*', 'tx_news_domain_model_news', $where);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment