Skip to content
Snippets Groups Projects

Issue #2707689: NodeForm::actions() checks for delete access on new entities

3 files
+ 225
7
Compare changes
  • Side-by-side
  • Inline
Files
3
  • 8d3c6fd3
    Issue #3206226 by Wim Leers, mglaman, lauriii, alexpott: Make updating changes... · 8d3c6fd3
    Alex Pott authored
    Issue #3206226 by Wim Leers, mglaman, lauriii, alexpott: Make updating changes from starterkit themes to generated themes easier
@@ -3,6 +3,7 @@
namespace Drupal\Core\Command;
use Composer\Autoload\ClassLoader;
use Composer\Semver\VersionParser;
use Drupal\Component\Serialization\Yaml;
use Drupal\Core\Extension\Extension;
use Drupal\Core\Extension\ExtensionDiscovery;
@@ -14,7 +15,9 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Question\ConfirmationQuestion;
use Symfony\Component\Console\Style\SymfonyStyle;
use Symfony\Component\Process\Process;
use Twig\Util\TemplateDirIterator;
/**
@@ -128,6 +131,43 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$info['core_version_requirement'] = '^' . $this->getVersion();
if (!array_key_exists('version', $info)) {
$confirm_versionless_source_theme = new ConfirmationQuestion(sprintf('The source theme %s does not have a version specified. This makes tracking changes in the source theme difficult. Are you sure you want to continue?', $source_theme->getName()));
if (!$io->askQuestion($confirm_versionless_source_theme)) {
return 0;
}
}
$source_version = $info['version'] ?? 'unknown-version';
if ($source_version === 'VERSION') {
$source_version = \Drupal::VERSION;
}
// A version in the generator string like "9.4.0-dev" is not very helpful.
// When this occurs, generate a version string that points to a commit.
if (VersionParser::parseStability($source_version) === 'dev') {
$git_check = Process::fromShellCommandline('git --help');
$git_check->run();
if ($git_check->getExitCode()) {
$io->error(sprintf('The source theme %s has a development version number (%s). Determining a specific commit is not possible because git is not installed. Either install git or use a tagged release to generate a theme.', $source_theme->getName(), $source_version));
return 1;
}
// Get the git commit for the source theme.
$git_get_commit = Process::fromShellCommandline("git rev-list --max-count=1 --abbrev-commit HEAD -C $source");
$git_get_commit->run();
if ($git_get_commit->getOutput() === '') {
$confirm_packaged_dev_release = new ConfirmationQuestion(sprintf('The source theme %s has a development version number (%s). Because it is not a git checkout, a specific commit could not be identified. This makes tracking changes in the source theme difficult. Are you sure you want to continue?', $source_theme->getName(), $source_version));
if (!$io->askQuestion($confirm_packaged_dev_release)) {
return 0;
}
$source_version .= '#unknown-commit';
}
else {
$source_version .= '#' . trim($git_get_commit->getOutput());
}
}
$info['generator'] = "$source_theme_name:$source_version";
if ($description = $input->getOption('description')) {
$info['description'] = $description;
}
Loading