commerce_funds causing: Expected argument of type "array or Traversable and ArrayAccess", "string" given

Created on 11 May 2020, over 4 years ago
Updated 21 September 2023, about 1 year ago

it is only compatible with ^8.7.7 || ^9 which is in the composer file.

πŸ› Bug report
Status

Closed: cannot reproduce

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States SocialNicheGuru

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

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡¨πŸ‡³China wqmeng

    Hello,

    I also find this problem on the Drupal 10.1.4-dev. Here is the error.

    What I have modification is to change the method parameter to be the following in the file
    web/modules/contrib/commerce_funds/commerce_funds.routing.yml

    But it will lose the regex validator, do not know how keep the validation if possible?

    Thank you.

    commerce_funds.withdrawal_methods.edit:
      path: '/user/{user}/withdrawal-methods/{method}/edit'
      defaults:
        _controller: '\Drupal\commerce_funds\Controller\WithdrawalMethods::editMethod'
        _title: 'Configure Withdrawal Methods'
        link_id: 'commerce_funds.withdrawal_methods.edit'
      requirements:
        _custom_access: '\Drupal\commerce_funds\Access\WithdrawalMethodAccessCheck::checkAccess'
      options:
        parameters:
          user:
            type: entity:user
            method:
              type: string
    User warning: Error while validating the route parameter definition in item : This value should be of type array|(Traversable&ArrayAccess). Original data: '^(\\w|-)+$' in Drupal\plugin\ParamConverter\PluginDefinitionConverter->validateParameterDefinition() (line 136 of modules/contrib/plugin/src/ParamConverter/PluginTypeBasedConverterTrait.php).
    
    Drupal\plugin\ParamConverter\PluginDefinitionConverter->validateParameterDefinition('^(\w|-)+$') (Line: 77)
    Drupal\plugin\ParamConverter\PluginDefinitionConverter->applies('^(\w|-)+$', 'method', Object) (Line: 61)
    Drupal\Core\ParamConverter\ParamConverterManager->setRouteParameterConverters(Object) (Line: 40)
    Drupal\Core\EventSubscriber\ParamConverterSubscriber->onRoutingRouteAlterSetParameterConverters(Object, 'routing.route_alter', Object)
    call_user_func(Array, Object, 'routing.route_alter', Object) (Line: 111)
    Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch(Object, 'routing.route_alter') (Line: 189)
    Drupal\Core\Routing\RouteBuilder->rebuild() (Line: 83)
    Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild() (Line: 518)
    drupal_flush_all_caches() (Line: 95)
    Drupal\devel\Controller\DevelController->cacheClear()
    call_user_func_array(Array, Array) (Line: 123)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 592)
    Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
    Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 182)
    Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
    Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58)
    Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106)
    Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85)
    Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48)
    Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51)
    Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
    Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
    
  • Status changed to Active about 1 year ago
  • πŸ‡¨πŸ‡³China wqmeng

    Change the status to be active.

  • πŸ‡­πŸ‡·Croatia Aporie

    I'm getting some work done for a new release.

    Reading this issue again, I'm pretty sure it's related to a payment method you are using.

    Can I ask which ones you were using?

    I'm revamping this route anyway as I mistakenly named a plug "bank-account" while it should have been "bank_account".

Production build 0.71.5 2024