Skip to content

Commit

Permalink
check that the content type exists - fixes #3626 (#3627)
Browse files Browse the repository at this point in the history
  • Loading branch information
malcomio authored and jmolivas committed Jan 7, 2018
1 parent f4e4437 commit 407b89e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Command/Config/ExportContentTypeCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
namespace Drupal\Console\Command\Config;

use Drupal\Console\Command\Shared\ModuleTrait;
use Symfony\Component\Console\Exception\InvalidOptionException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -169,6 +170,10 @@ protected function execute(InputInterface $input, OutputInterface $output)

$contentTypeNameConfig = $this->getConfiguration($contentTypeName, $removeUuid, $removeHash);

if (empty($contentTypeNameConfig)) {
throw new InvalidOptionException(sprintf('The content type %s does not exist.', $contentType));
}

$this->configExport[$contentTypeName] = ['data' => $contentTypeNameConfig, 'optional' => $optionalConfig];

$this->getFields($contentType, $optionalConfig, $removeUuid, $removeHash);
Expand Down

0 comments on commit 407b89e

Please sign in to comment.