Skip to content

Commit

Permalink
issue #2483 fix for create:node (#2487)
Browse files Browse the repository at this point in the history
  • Loading branch information
sag13684 authored and enzolutions committed Jul 3, 2016
1 parent 6732752 commit 6d23fc8
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/Command/Create/NodesCommand.php
Expand Up @@ -130,9 +130,16 @@ protected function execute(InputInterface $input, OutputInterface $output)
$limit = $input->getOption('limit')?:25;
$titleWords = $input->getOption('title-words')?:5;
$timeRange = $input->getOption('time-range')?:31536000;
$available_types = array_keys($this->getDrupalApi()->getBundles());

foreach ($contentTypes as $type) {
if (!in_array($type, $available_types)) {
throw new \Exception('Invalid content type name given.');
}
}

if (!$contentTypes) {
$contentTypes = array_keys($this->getApplication()->getDrupalApi()->getBundles());
$contentTypes = $available_types;
}

$nodes = $createNodes->createNode(
Expand Down

0 comments on commit 6d23fc8

Please sign in to comment.