Hello,

I'm getting the following error when I try to update from 8.7.10 to 8.8.0 using drush updb

The two updates that fail are

views module
Define default values for limit operators settings in all filters.
Remove core key from views configuration.

With error

In ProcessBase.php line 188:
                                                                                                                                                                          
  Unable to decode output into JSON: Syntax error                                                                                                                         
                                                                                                                                                                          
  ArgumentCountError: Too few arguments to function Drupal\taxonomy\Plugin\views\argument\IndexTidDepth::__construct(), 4 passed in /core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php on line 54 and exactly 5 expected in Drupal\taxonomy\Plugin\views\argument\IndexTidDepth->__cons  
  truct() (line 39 of /core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php). 

Any suggestions?

Regards,

Comments

mellowtothemax created an issue. See original summary.

cilefen’s picture

Status: Active » Postponed (maintainer needs more info)

What is the Drush version?

Does /update.php work?

mellowtothemax’s picture

Drush is version 10 but it happens with 9 also. No the same error from the browser.

Full drush output if it helps

drush updb
 -------- ------------------------- ------------- ----------------------------- 
  Module   Update ID                 Type          Description                  
 -------- ------------------------- ------------- ----------------------------- 
  views    limit_operator_defaults   post-update   Define default values for    
                                                   limit operators settings in  
                                                   all filters.                 
  views    remove_core_key           post-update   Remove core key from views   
                                                   configuration.               
 -------- ------------------------- ------------- ----------------------------- 


 Do you wish to run the specified pending updates? (yes/no) [yes]:
 > 

>  [notice] Update started: views_post_update_limit_operator_defaults
>  [error]  ArgumentCountError: Too few arguments to function Drupal\taxonomy\Plugin\views\argument\IndexTidDepth::__construct(), 4 passed in /core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php on line 54 and exactly 5 expected in Drupal\taxonomy\Plugin\views\argument\IndexTidDepth->__construct() (line 39 of /core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php) #0 /core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php(54): Drupal\taxonomy\Plugin\views\argument\IndexTidDepth->__construct(Array, 'taxonomy_index_...', Array, Object(Drupal\taxonomy\TermStorage))
> #1 /core/lib/Drupal/Core/Plugin/Factory/ContainerFactory.php(21): Drupal\taxonomy\Plugin\views\argument\IndexTidDepth::create(Object(Drupal\Core\DependencyInjection\ContainerBuilder), Array, 'taxonomy_index_...', Array)
> #2 /core/lib/Drupal/Component/Plugin/PluginManagerBase.php(76): Drupal\Core\Plugin\Factory\ContainerFactory->createInstance('taxonomy_index_...', Array)
> #3 /core/modules/views/src/Plugin/ViewsHandlerManager.php(121): Drupal\Component\Plugin\PluginManagerBase->createInstance('taxonomy_index_...', Array)
> #4 /core/modules/views/src/Plugin/ViewsHandlerManager.php(106): Drupal\views\Plugin\ViewsHandlerManager->createInstance('taxonomy_index_...', Array)
> #5 /core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(891): Drupal\views\Plugin\ViewsHandlerManager->getHandler(Array, NULL)
> #6 /core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(925): Drupal\views\Plugin\views\display\DisplayPluginBase->getHandlers('argument')
> #7 /core/modules/views/src/Plugin/views/display/DisplayPluginBase.php(961): Drupal\views\Plugin\views\display\DisplayPluginBase->getAllHandlers(true)
> #8 /core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(75): Drupal\views\Plugin\views\display\DisplayPluginBase->calculateDependencies()
> #9 /core/lib/Drupal/Core/Plugin/PluginDependencyTrait.php(93): Drupal\Core\Config\Entity\ConfigEntityBase->getPluginDependencies(Object(Drupal\ctools_views\Plugin\Display\Block))
> #10 /core/modules/views/src/Entity/View.php(284): Drupal\Core\Config\Entity\ConfigEntityBase->calculatePluginDependencies(Object(Drupal\ctools_views\Plugin\Display\Block))
> #11 /core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(319): Drupal\views\Entity\View->calculateDependencies()
> #12 /core/modules/views/src/Entity/View.php(294): Drupal\Core\Config\Entity\ConfigEntityBase->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
> #13 /core/lib/Drupal/Core/Entity/EntityStorageBase.php(499): Drupal\views\Entity\View->preSave(Object(Drupal\Core\Config\Entity\ConfigEntityStorage))
> #14 /core/lib/Drupal/Core/Entity/EntityStorageBase.php(454): Drupal\Core\Entity\EntityStorageBase->doPreSave(Object(Drupal\views\Entity\View))
> #15 /core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php(263): Drupal\Core\Entity\EntityStorageBase->save(Object(Drupal\views\Entity\View))
> #16 /core/lib/Drupal/Core/Entity/EntityBase.php(395): Drupal\Core\Config\Entity\ConfigEntityStorage->save(Object(Drupal\views\Entity\View))
> #17 /core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php(613): Drupal\Core\Entity\EntityBase->save()
> #18 /core/lib/Drupal/Core/Config/Entity/ConfigEntityUpdater.php(118): Drupal\Core\Config\Entity\ConfigEntityBase->save()
> #19 /core/modules/views/views.post_update.php(474): Drupal\Core\Config\Entity\ConfigEntityUpdater->update(Array, 'view', Object(Closure))
> #20 /vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(309): views_post_update_limit_operator_defaults(Array)
> #21 /vendor/drush/drush/includes/batch.inc(254): Drush\Commands\core\UpdateDBCommands::updateDoOnePostUpdate('views_post_upda...', Object(DrushBatchContext))
> #22 /vendor/drush/drush/includes/batch.inc(199): _drush_batch_worker()
> #23 /vendor/drush/drush/includes/batch.inc(100): _drush_batch_command('359')
> #24 /vendor/drush/drush/src/Commands/core/UpdateDBCommands.php(167): drush_batch_command('359')
> #25 [internal function]: Drush\Commands\core\UpdateDBCommands->process('359', Array)
> #26 /vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
> #27 /vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #28 /vendor/consolidation/annotated-command/src/CommandProcessor.php(178): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #29 /vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
> #30 /vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #31 /vendor/symfony/console/Application.php(1000): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #32 /vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #33 /vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #34 /vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
> #35 /vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
> #36 /vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
> #37 /vendor/drush/drush/drush(4): require('/p...')
> #38 {main}. 
>  [warning] Drush command terminated abnormally. Check for an exit() in your Drupal site.

In ProcessBase.php line 188:
                                                                                                                                                                          
  Unable to decode output into JSON: Syntax error                                                                                                                         
                                                                                                                                                                          
  ArgumentCountError: Too few arguments to function Drupal\taxonomy\Plugin\views\argument\IndexTidDepth::__construct(), 4 passed in /docr  
  oot/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php on line 54 and exactly 5 expected in Drupal\taxonomy\Plugin\views\argument\IndexTidDepth->__cons  
  truct() (line 39 of /docroot/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php).                                         
                                                                                                                                                                          

updatedb [--cache-clear [CACHE-CLEAR]] [--entity-updates] [--post-updates [POST-UPDATES]] [--no-cache-clear] [--no-post-updates] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-d|--debug] [-y|--yes] [--no] [--remote-host REMOTE-HOST] [--remote-user REMOTE-USER] [-r|--root ROOT] [-l|--uri URI] [--simulate] [--pipe] [-D|--define DEFINE] [--druplicon] [--xh-link XH-LINK] [--notify] [--] <command>
berdir’s picture

How does the constructor of core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php look like? There should only be 4 arguments, do you have any patches applied that didn't fully apply or something?

krzysztof domański’s picture

Priority: Critical » Normal
Status: Postponed (maintainer needs more info) » Fixed

I confirm Berdir's suggestion.

@mellowtothemax You must reroll patch that modifies an IndexTidDepth.php file. Maybe you're using a patch from #2765297: Return translated term name on views "Content: Has taxonomy term ID (with depth)".

It's probably related to small refactoring with 408c540. The code may be malformed after applying the old patch.

--- a/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php
+++ b/core/modules/taxonomy/src/Plugin/views/argument/IndexTidDepth.php
@@ -40,7 +40,12 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
    * {@inheritdoc}
    */
   public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {
-    return new static($configuration, $plugin_id, $plugin_definition, $container->get('entity.manager')->getStorage('taxonomy_term'));
+    return new static(
+      $configuration,
+      $plugin_id,
+      $plugin_definition,
+      $container->get('entity_type.manager')->getStorage('taxonomy_term')
+    );
   }
mellowtothemax’s picture

Thank you both, Krzysztof Domański you were right on the money with the solution. I had patch 23 applied and had forgotten to alter my composer.json with the updated patches. Using the latest patch fixed the issue and the update completed successfully.

Will keep an eye on my patches from now on.

berdir’s picture

See https://twitter.com/berdir/status/1203596784150499329, with that setting this should be much more visible as it will abort hard and early in such a case.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.