Skip to content

Commit

Permalink
Fixed regression : --test-content-object option not working after PR#49
Browse files Browse the repository at this point in the history
  • Loading branch information
vidarl committed Jun 26, 2018
1 parent 43032b4 commit 8fe772f
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions bundle/Command/ConvertXmlTextToRichTextCommand.php
Expand Up @@ -148,9 +148,11 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->convertFieldDefinitions($dryRun, $output);
} else {
$dryRun = true;
$this->convertFields($dryRun, $testContentId, !$input->getOption('disable-duplicate-id-check'), !$input->getOption('disable-id-value-check'), null, null);
return;
}

$this->processFields($dryRun, $testContentId, !$input->getOption('disable-duplicate-id-check'), !$input->getOption('disable-id-value-check'), $output);
$this->processFields($dryRun, !$input->getOption('disable-duplicate-id-check'), !$input->getOption('disable-id-value-check'), $output);
}

protected function baseExecute(InputInterface $input, OutputInterface $output, &$dryRun)
Expand Down Expand Up @@ -523,13 +525,13 @@ protected function convertFields($dryRun, $contentId, $checkDuplicateIds, $check
}
}

protected function processFields($dryRun, $contentId, $checkDuplicateIds, $checkIdValues, OutputInterface $output)
protected function processFields($dryRun, $checkDuplicateIds, $checkIdValues, OutputInterface $output)
{
$count = $this->getRowCountOfContentObjectAttributes('ezxmltext', $contentId);
$count = $this->getRowCountOfContentObjectAttributes('ezxmltext', null);
$output->writeln("Found $count field rows to convert.");

$offset = 0;
$fork = $this->maxConcurrency > 1 && $contentId === null;
$fork = $this->maxConcurrency > 1;

while ($offset + self::MAX_OJBECTS_PER_CHILD <= $count) {
$limit = self::MAX_OJBECTS_PER_CHILD;
Expand All @@ -538,7 +540,7 @@ protected function processFields($dryRun, $contentId, $checkDuplicateIds, $check
$process = $this->createChildProcess($dryRun, $checkDuplicateIds, $checkIdValues, $offset, $limit, $output);
$this->processes[$process->getPid()] = ['offset' => $offset, 'limit' => $limit, 'process' => $process];
} else {
$this->convertFields($dryRun, $contentId, $checkDuplicateIds, $checkIdValues, $offset, $limit);
$this->convertFields($dryRun, null, $checkDuplicateIds, $checkIdValues, $offset, $limit);
}
$offset += self::MAX_OJBECTS_PER_CHILD;
}
Expand Down

0 comments on commit 8fe772f

Please sign in to comment.