Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix form generator #2767

Merged
merged 2 commits into from
Oct 5, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/services/drupal-console/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ services:
- { name: drupal.command }
console.update_execute:
class: Drupal\Console\Command\Update\ExecuteCommand
arguments: ['@console.site', '@state', '@module_handler', '@update.post_update_registry', '@console.chain_queue']
arguments: ['@console.site', '@state', '@module_handler', '@update.post_update_registry', '@console.extension_manager', '@console.chain_queue']
tags:
- { name: drupal.command }
4 changes: 2 additions & 2 deletions src/Command/Generate/FormCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
use Drupal\Console\Command\Shared\FormTrait;
use Symfony\Component\Console\Command\Command;
use Drupal\Console\Style\DrupalStyle;
use Drupal\Console\Command\Shared\CommandTrait;
use Drupal\Console\Command\Shared\ContainerAwareCommandTrait;

abstract class FormCommand extends Command
{
use ModuleTrait;
use ServicesTrait;
use FormTrait;
use MenuTrait;
use CommandTrait;
use ContainerAwareCommandTrait;

private $formType;
private $commandName;
Expand Down
14 changes: 10 additions & 4 deletions src/Command/Update/ExecuteCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@
use Drupal\Core\Update\UpdateRegistry;
use Drupal\Console\Command\Shared\CommandTrait;
use Drupal\Console\Style\DrupalStyle;
use Drupal\Console\Utils\ChainQueue;
use Drupal\Console\Utils\Site;
use Drupal\Console\Extension\Manager;
use Drupal\Console\Utils\ChainQueue;

class ExecuteCommand extends Command
{
Expand All @@ -43,6 +44,10 @@ class ExecuteCommand extends Command
*/
protected $postUpdateRegistry;


/** @var Manager */
protected $extensionManager;

/**
* @var ChainQueue
*/
Expand All @@ -64,19 +69,22 @@ class ExecuteCommand extends Command
* @param StateInterface $state
* @param ModuleHandler $moduleHandler
* @param UpdateRegistry $postUpdateRegistry
* @param Manager $extensionManager
* @param ChainQueue $chainQueue
*/
public function __construct(
Site $site,
StateInterface $state,
ModuleHandler $moduleHandler,
UpdateRegistry $postUpdateRegistry,
Manager $extensionManager,
ChainQueue $chainQueue
) {
$this->site = $site;
$this->state = $state;
$this->moduleHandler = $moduleHandler;
$this->postUpdateRegistry = $postUpdateRegistry;
$this->extensionManager = $extensionManager;
$this->chainQueue = $chainQueue;
parent::__construct();
}
Expand Down Expand Up @@ -169,10 +177,8 @@ private function checkUpdates(DrupalStyle $io)
private function runUpdates(DrupalStyle $io, $updates)
{
foreach ($updates as $module_name => $module_updates) {
$modulePath = $this->getApplication()->getSite()
->getModulePath($this->module);
$this->site
->loadLegacyFile($modulePath . '/'. $this->module . '.install', false);
->loadLegacyFile($this->extensionManager->getModule($this->module)->getPath() . '/'. $this->module . '.install', false);

foreach ($module_updates['pending'] as $update_number => $update) {
if ($this->module != 'all' && $this->update_n !== null && $this->update_n != $update_number) {
Expand Down