Problem/Motivation

Drupal database update failed : Update process was canceled prematurely while performing update # in taxonomy_import_post_update_replace_misnamed_config.module.

Drupal database update failed after upgrading taxonomy import in the last stable version 2.0.8.

Here is the report :

ArgumentCountError : Too few arguments to function Drupal\Core\Config\Config::set(), 1 passed in /[...]/web/modules/contrib/taxonomy_import/taxonomy_import.post_update.php on line 16 and exactly 2 expected dans Drupal\Core\Config\Config->set() (/[...]/web/core/lib/Drupal/Core/Config/Config.php ligne 183)
#0 /[...]/web/modules/contrib/taxonomy_import/taxonomy_import.post_update.php(16): Drupal\Core\Config\Config->set(Array)
#1 /[...]/web/core/includes/update.inc(295): taxonomy_import_post_update_replace_misnamed_config(Array)
#2 /[...]/web/core/includes/batch.inc(295): update_invoke_post_update('taxonomy_import...', Array)
#3 /[...]/web/core/includes/batch.inc(137): _batch_process()
#4 /[...]/web/core/includes/batch.inc(93): _batch_do()
#5 /[...]/web/core/modules/system/src/Controller/DbUpdateController.php(186): _batch_page(Object(Symfony\Component\HttpFoundation\Request))
#6 [internal function]: Drupal\system\Controller\DbUpdateController->handle('start', Object(Symfony\Component\HttpFoundation\Request))
#7 /[...]/web/core/lib/Drupal/Core/Update/UpdateKernel.php(115): call_user_func_array(Array, Array)
#8 /[...]/web/core/lib/Drupal/Core/Update/UpdateKernel.php(76): Drupal\Core\Update\UpdateKernel->handleRaw(Object(Symfony\Component\HttpFoundation\Request))
#9 /[...]/web/update.php(27): Drupal\Core\Update\UpdateKernel->handle(Object(Symfony\Component\HttpFoundation\Request))
#10 {main}
.

Steps to reproduce

Drupal 9.4.8 / PHP 8.0.8
Run composer update
Upgrading drupal/taxonomy_import (2.0.5 => 2.0.8)
Run update.php

CommentFileSizeAuthor
#5 use-setData-3314273-5.patch475 bytesjon nunan

Comments

fredfab created an issue. See original summary.

fredfab’s picture

It seems that drupal/core/config.php require two arguments in line 183: ($key, $value)
and that taxonomy_import.post_update.php only give one argument on line 16: $config->set($values)

https://www.zupimages.net/up/22/40/e7uf.png

mjchadwick’s picture

I also just ran into this issue, with a similar environment. I'd fix it locally, but not sure which config key is correct, so please patch as soon as possible.

jon nunan’s picture

I think its actually meant to be using $config->setData($values); as its copying the whole config object from one name to another. Unfortunately it also seems to delete the old config object before writing the new one, but I think theres only 2 values in there anyway.

jon nunan’s picture

StatusFileSize
new475 bytes

just attaching patch

rishi.kulshreshtha’s picture

Version: 2.0.8 » 2.0.x-dev
Status: Active » Reviewed & tested by the community

I've tried the provided patch on Drupal 9.4.8 & it got applied cleanly & did the job. Thank you @Jon Nunan!

fredfab’s picture

Perfect! Thanks to @Jon Nunan, I can confirm the patch is working just fine.

  • vuil committed 6369273 on 2.0.x
    Issue #3314273 by Jon Nunan, fredfab, mjchadwick, Rishi Kulshreshtha,...
vuil’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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