Getting Error: "Too few arguments to function"

Created on 21 October 2024, 6 months ago

Installed 2.0.0-beta2 version of the Domain module (2.0.0-beta2 released 18 September 2024)

When I try to access /admin/config/domain/domain_access_logo I'm getting this error:

ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /var/www/sam/modules/contrib/domain_access_logo/src/Form/DomainAccessLogoSettingsForm.php on line 53 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 43 of core/lib/Drupal/Core/Form/ConfigFormBase.php).

Drupal\domain_access_logo\Form\DomainAccessLogoSettingsForm->__construct() (Line: 70)
Drupal\domain_access_logo\Form\DomainAccessLogoSettingsForm::create() (Line: 36)
Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48)
Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58)
Drupal\Core\Controller\FormController->getContentResult()
call_user_func_array() (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 106)
Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 85)
Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
Drupal\Core\DrupalKernel->handle() (Line: 19)
๐Ÿ’ฌ Support request
Status

Active

Version

2.0

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ฟUzbekistan biarr

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

Merge Requests

Comments & Activities

  • Issue created by @biarr
  • First commit to issue fork.
  • Merge request !19Fixed arguments to function issue โ†’ (Merged) created by Unnamed author
  • Pipeline finished with Success
    6 months ago
    Total: 135s
    #316962
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sarwan_verma

    Hi,

    I have resolved the "arguments to function" issue and created MR!9. For your reference, I have also attached a screenshot.

    Please review and verify.

    Thank you!

  • ๐Ÿ‡บ๐Ÿ‡ฟUzbekistan biarr

    Thank you for prompt response and fix. I confirm that MR!9 fixes the problem.

  • ๐Ÿ‡บ๐Ÿ‡ฟUzbekistan biarr
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia Raveen Kumar

    raveen_thakur51 โ†’ made their first commit to this issueโ€™s fork.

  • Pipeline finished with Success
    6 months ago
    Total: 134s
    #318050
  • ๐Ÿ‡บ๐Ÿ‡ฟUzbekistan biarr

    It is working I could upload logos for each domain. Logos are also correctly rendering in each domain. Thank you very much!

  • ๐Ÿ‡จ๐Ÿ‡ณChina hongqing

    Encountered the error with 2.0 and 2.0.x-dev.

    The website encountered an unexpected error. Try again later.
    
    ArgumentCountError: Too few arguments to function Drupal\Core\Form\ConfigFormBase::__construct(), 1 passed in /www/wwwroot/test/web/modules/contrib/domain_access_logo/src/Form/DomainAccessLogoSettingsForm.php on line 53 and exactly 2 expected in Drupal\Core\Form\ConfigFormBase->__construct() (line 44 of core/lib/Drupal/Core/Form/ConfigFormBase.php).
    Drupal\domain_access_logo\Form\DomainAccessLogoSettingsForm->__construct() (Line: 70)
    Drupal\domain_access_logo\Form\DomainAccessLogoSettingsForm::create() (Line: 36)
    Drupal\Core\DependencyInjection\ClassResolver->getInstanceFromDefinition() (Line: 48)
    Drupal\Core\Controller\HtmlFormController->getFormObject() (Line: 58)
    Drupal\Core\Controller\FormController->getContentResult()
    call_user_func_array() (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 593)
    Drupal\Core\Render\Renderer->executeInRenderContext() (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext() (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 183)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw() (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle() (Line: 53)
    Drupal\Core\StackMiddleware\Session->handle() (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle() (Line: 28)
    Drupal\Core\StackMiddleware\ContentLength->handle() (Line: 32)
    Drupal\big_pipe\StackMiddleware\ContentLength->handle() (Line: 116)
    Drupal\page_cache\StackMiddleware\PageCache->pass() (Line: 90)
    Drupal\page_cache\StackMiddleware\PageCache->handle() (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle() (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle() (Line: 36)
    Drupal\Core\StackMiddleware\AjaxPageState->handle() (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle() (Line: 709)
    Drupal\Core\DrupalKernel->handle() (Line: 19)
  • Status changed to RTBC about 2 months ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช

    This issue report is far from a good error report. It does not contain the drupal version, the version of the module at the moment the error appeared.

    I can however confirm there is an issue when using the module in Drupal 11.x with deprecated code. Sorry for that.
    I'm going to test this on a Drupal 10.x site and a Drupal 11.x site and see if everything in the MR works.
    I'll report back later if I found the time.

    Of if anyone finds the time to test both versions, feel free to provide the reports.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช

    And PHPCS failed.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช

    Updated Drupal version constraints because of deprecations in code.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช

    Test fails on Drupal 11.x because of

    PHP Fatal error: Declaration of Drupal\Tests\domain\Functional\DomainTestBase::drupalUserIsLoggedIn(Drupal\Core\Session\AccountInterface $account) must be compatible with Drupal\Tests\BrowserTestBase::drupalUserIsLoggedIn(Drupal\Core\Session\AccountInterface $account): bool in /builds/project/domain_access_logo/web/modules/contrib/domain/domain/tests/src/Functional/DomainTestBase.php on line 203

    So have to look into domain module itself to see if that can get fixed there. But for me everything else is working as it should be and this test will help in 1 of the error cases. If someone feels like writing a test for actually uploading the file would be very nice! Leaving this open for a while and if no one picks it up, we'll create a follow up issue for that.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช

    Looks like the issue in domain is already tackled, see ๐Ÿ“Œ Add function return type for DomainTestBase::drupalUserIsLoggedIn Active . Domain just needs a new release.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช

    Added tests, test is failing on drupal 11.x because of domain needing a new release. But that does not need to block us.

  • ๐Ÿ‡ง๐Ÿ‡ชBelgium tim-diels Belgium ๐Ÿ‡ง๐Ÿ‡ช
Production build 0.71.5 2024