diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php index 975d971..4366cb2 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Form/VocabularyResetForm.php @@ -10,6 +10,7 @@ use Drupal\Core\Database\Connection; use Drupal\Core\Entity\EntityConfirmFormBase; use Drupal\Core\Entity\EntityControllerInterface; +use Drupal\Core\Extension\ModuleHandlerInterface; use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\HttpFoundation\Request; @@ -23,14 +24,15 @@ class VocabularyResetForm extends EntityConfirmFormBase implements EntityControl * * @var \Drupal\Core\Database\Connection */ - protected $database; + protected $connection; /** - * Constructs a VocabularyReset object. + * Constructs a new VocabularyResetForm object. */ - public function __construct(Connection $database) { - $this->database = $database; + public function __construct(ModuleHandlerInterface $module_handler, Connection $connection) { + parent::__construct($module_handler); + $this->connection = $connection; } /** @@ -38,6 +40,7 @@ public function __construct(Connection $database) { */ public static function createInstance(ContainerInterface $container, $entity_type, array $entity_info) { return new static( + $container->get('module_handler'), $container->get('database') ); } @@ -80,8 +83,8 @@ public function getConfirmText() { /** * {@inheritdoc} */ - public function submitForm(array &$form, array &$form_state) { - $this->database->update('taxonomy_term_data') + public function save(array $form, array &$form_state) { + $this->connection->update('taxonomy_term_data') ->fields(array('weight' => 0)) ->condition('vid', $this->entity->id()) ->execute(); diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php index cc912cf..abcb75b 100644 --- a/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php +++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Plugin/Core/Entity/Vocabulary.php @@ -26,8 +26,8 @@ * "list" = "Drupal\taxonomy\VocabularyListController", * "form" = { * "default" = "Drupal\taxonomy\VocabularyFormController", - * "delete" = "Drupal\taxonomy\Form\VocabularyDeleteForm", - * "reset" = "Drupal\taxonomy\Form\VocabularyResetForm" + * "reset" = "Drupal\taxonomy\Form\VocabularyResetForm", + * "delete" = "Drupal\taxonomy\Form\VocabularyDeleteForm" * } * }, * config_prefix = "taxonomy.vocabulary", diff --git a/core/modules/taxonomy/taxonomy.admin.inc b/core/modules/taxonomy/taxonomy.admin.inc index 43ad4b5..876c49c 100644 --- a/core/modules/taxonomy/taxonomy.admin.inc +++ b/core/modules/taxonomy/taxonomy.admin.inc @@ -5,7 +5,6 @@ * Administrative page callbacks for the taxonomy module. */ -use Drupal\taxonomy\Plugin\Core\Entity\Term; use Drupal\taxonomy\Plugin\Core\Entity\Vocabulary; /** diff --git a/core/modules/taxonomy/taxonomy.routing.yml b/core/modules/taxonomy/taxonomy.routing.yml index 9a6204d..09dc6d0 100644 --- a/core/modules/taxonomy/taxonomy.routing.yml +++ b/core/modules/taxonomy/taxonomy.routing.yml @@ -31,4 +31,4 @@ taxonomy_vocabulary_reset: defaults: _entity_form: 'taxonomy_vocabulary.reset' requirements: - _entity_access: 'taxonomy_vocabulary.view' + _permission: 'administer taxonomy'