Fatal error: Uncaught ArgumentCountError: Too few arguments to function

Created on 24 December 2024, 29 days ago

Getting below error when I upgraded this module from 2.x to 3.x along with D9 to D10.

36 {main}
thrown in /var/www/html/web/modules/contrib/custom_field/src/Normalizer/EntityReferenceNormalizer.php on line 30

Fatal error: Uncaught ArgumentCountError: Too few arguments to function Drupal\custom_field\Normalizer\EntityReferenceNormalizer::__construct(), 0 passed in /var/www/html/web/core/lib/Drupal/Component/DependencyInjection/Container.php on line 261 and exactly 1 expected in /var/www/html/web/modules/contrib/custom_field/src/Normalizer/EntityReferenceNormalizer.php:30

🐛 Bug report
Status

Needs work

Version

3.0

Component

Code

Created by

🇮🇳India j2r

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @j2r
  • 🇺🇸United States apmsooner

    The 3.x version has been out for quite a while and 2.x should be able to update to it. Seems like a couple cache clears should get the service.yml recognized with the arguments being passed in. Perhaps make sure you've updated to the highest minor version of 2.x for this module and highest core supported and run all updates. Then maybe try 3.x. Otherwise, not sure how to help you as i can't really support 2.x anymore with so few users on it at this point and such differences between the versions.

  • 🇺🇸United States apmsooner

    There's nothing I can do to fix this. There are so few sites on 1.x/2.x that its not worth my time to put forth the effort and I've marked 2.x as no longer supported due to such significant changes in Core dependencies. As I said, 3.x has been available for quite some time and many have upgraded from 2.x (including myself) without issue. I can only suggest updating in smaller version steps to get to a point of successful update. Otherwise, you can patch your own site by probably just removing the EntityReferenceNormalizer file and service declaration (see custom_field.services.yml) to get past the error and than add it back in.

Production build 0.71.5 2024