Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
We've previously been using this module, but recently noticed an issue when using a dev version that this issue was occurring with save(), which actually appears to have been fixed by:
https://www.drupal.org/project/name/issues/3163645
And is now committed into the latest dev version.
After pulling in latest dev into my codebase, and running database updates, I am seeing this error:
ArgumentCountError: Too few arguments to function Drupal\Core\Config\Entity\ConfigEntityStorage::save(), 0 passed in /home/vagrant/docroot/docroot/modules/contrib/name/name.post_update.php on line 38 and exactly 1 expected in /home/vagrant/docroot/docroot/core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php on line 248 #0 /home/vagrant/docroot/docroot/modules/contrib/name/name.post_update.php(38): Drupal\Core\Config\Entity\ConfigEntityStorage->save()
Comment | File | Size | Author |
---|---|---|---|
#6 | 3165930-name-config-entity-save-error.patch | 1.04 KB | JeremySkinner |
#2 | 3165930-name-config-entity-save-error.patch | 687 bytes | joshua.boltz |
Comments
Comment #2
joshua.boltz CreditAttribution: joshua.boltz at Mediacurrent commentedI've attached a patch that appears to fix this issue.
I think the problem was the previous code was calling ->save() on a ConfigEntityStorage instance, which expected one parameter provided to the function.
Starting around line 15 of name.post_update.php, the previous code was
My patch updates the code to be this instead:
The patch I added works similarly to the above if() conditional in that same post update function, with how the $default_list works. Whereas that code is loading a default list, if else conditional where this problem was occurring was creating a list first, and then calling save() on it.
Comment #3
joshua.boltz CreditAttribution: joshua.boltz at Mediacurrent commentedComment #5
Alan D. CreditAttribution: Alan D. commentedJust push it through, that update hook is super old ;)
Comment #6
JeremySkinner CreditAttribution: JeremySkinner commentedI'm also running into this problem. The original patch resolves the issue, although the tests were complaining about an unrelated coding standards issue in the same file (doc comment line was too long). The attached patch includes the original fix and also fixes the coding standards issue. Please can this be merged?
Comment #8
JeremySkinner CreditAttribution: JeremySkinner commentedComment #10
nkoporec@JeremySkinner the tests are still failing ... once those are fixed, I will merge the patch.
Comment #11
JeremySkinner CreditAttribution: JeremySkinner commentedHi @nkoporec the reason that the build isn't marked as successful isn't related to this patch (phpunit says "ERROR: No valid tests were specified.") - this regardless of whether this patch is applied or not - please see the build output. It would be great if this could be merged - it doesn't affect the tests one way or the other and actively prevents this module from being upgraded.
If the test issue is a problem, then that needs to be handled as a separate patch/issue as it's not related to this, but this is actively blocking the module's db updates from being able to run so would be good if this could go in sooner rather than later. Thanks!
Comment #12
JeremySkinner CreditAttribution: JeremySkinner commentedQuick followup: looking at here https://www.drupal.org/pift-ci-job/1700584 tests stopped working on 13th August (and affects all patches/commits since that date). I'll open a separate issue for it.
Comment #14
nkoporecoh missed the test output, we should create a seperate issue for that ... commited #8 to 8.x-1.x branch. Thanks for the patch @JeremySkinner.
Comment #15
JeremySkinner CreditAttribution: JeremySkinner commentedPerfect, thanks!
I'm assuming the testing issue is because the tests are still using simpletest rather than phpunit (I believe drupalci stopped supporting simpletest). I've created #3172223