Error Drupal\plugin\ParamConverter\PluginTypeConverter->getConverterDefinition('[0-1]+')

Created on 25 October 2020, about 4 years ago
Updated 16 January 2024, 10 months ago

Problem/Motivation

Because of a plugin definition in social_event I get the following error:

TypeError: Argument 1 passed to Drupal\plugin\ParamConverter\PluginTypeConverter::getConverterDefinition() must be of the type array, string given, called in drupal/html/modules/contrib/plugin/src/ParamConverter/PluginTypeBasedConverterTrait.php on line 82 in drupal/html/modules/contrib/plugin/src/ParamConverter/PluginTypeBasedConverterTrait.php on line 97 #0 drupal/html/modules/contrib/plugin/src/ParamConverter/PluginTypeBasedConverterTrait.php(82): Drupal\plugin\ParamConverter\PluginTypeConverter->getConverterDefinition('[0-1]+')
#1 drupal/html/core/lib/Drupal/Core/ParamConverter/ParamConverterManager.php(61): Drupal\plugin\ParamConverter\PluginTypeConverter->applies('[0-1]+', 'approve', Object(Symfony\Component\Routing\Route))
#2 drupal/html/core/lib/Drupal/Core/EventSubscriber/ParamConverterSubscriber.php(40): Drupal\Core\ParamConverter\ParamConverterManager->setRouteParameterConverters(Object(Symfony\Component\Routing\RouteCollection))
#3 [internal function]: Drupal\Core\EventSubscriber\ParamConverterSubscriber->onRoutingRouteAlterSetParameterConverters(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#4 drupal/html/core/lib/Drupal/Component/EventDispatcher/ContainerAwareEventDispatcher.php(111): call_user_func(Array, Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#5 drupal/html/core/lib/Drupal/Core/Routing/RouteBuilder.php(189): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('routing.route_a...', Object(Drupal\Core\Routing\RouteBuildEvent))
#6 drupal/html/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#7 drupal/html/core/lib/Drupal/Core/Extension/ModuleInstaller.php(345): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#8 drupal/html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#9 drupal/html/modules/cci_features/cci_core_drupal/cci_core_drupal.install(27): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array)
#10 [internal function]: cci_core_drupal_install()
#11 drupal/html/core/lib/Drupal/Core/Extension/ModuleHandler.php(392): call_user_func_array('cci_core_drupal...', Array)
#12 drupal/html/core/lib/Drupal/Core/Extension/ModuleInstaller.php(326): Drupal\Core\Extension\ModuleHandler->invoke('cci_core_drupal', 'install')
#13 drupal/html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#14 phar:///usr/local/bin/drush/commands/core/drupal/environment.inc(131): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#15 phar:///usr/local/bin/drush/commands/core/drupal/environment.inc(198): drush_module_install(Array)
#16 phar:///usr/local/bin/drush/commands/pm/pm.drush.inc(1180): drush_module_enable(Array)
#17 phar:///usr/local/bin/drush/includes/command.inc(422): drush_pm_enable('cci_core_drupal')
#18 phar:///usr/local/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
#19 phar:///usr/local/bin/drush/includes/command.inc(199): drush_command('cci_core_drupal')
#20 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
#21 phar:///usr/local/bin/drush/includes/preflight.inc(66): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
#22 phar:///usr/local/bin/drush/includes/startup.inc(462): drush_main()
#23 phar:///usr/local/bin/drush/includes/startup.inc(369): drush_run_main(false, '/', 'Phar detected. ...')
#24 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
#25 /usr/local/bin/drush(10): require('phar:///usr/loc...')
#26 {main}

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

๐Ÿ› Bug report
Status

Needs work

Version

2.8

Component

Code

Created by

๐Ÿ‡บ๐Ÿ‡ธUnited States SocialNicheGuru

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

Merge Requests

Comments & Activities

Not all content is available!

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

  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim
    +++ b/plugin/src/ParamConverter/PluginTypeBasedConverterTrait.php
    @@ -79,7 +79,7 @@ public function applies($definition, $name, Route $route) {
    +    if (is_null($this->getConverterDefinition((array)$definition))) {
    

    Casting to the right type is not the right fix. We need to figure out why the wrong type of value is arriving here.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia tarunyaduvanshi

    #2
    Hi @SocialNicheGuru,

    I have same issue and apply this patch my issue is resolved.

    Thanks

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chetan 11

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

  • Merge request !6fixed โ†’ (Open) created by chetan 11
  • Open on Drupal.org โ†’
    Core: 9.5.5 + Environment: PHP 7.3 & MariaDB 10.3.22
    last update 10 months ago
    Waiting for branch to pass
  • Status changed to Needs review 10 months ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia chetan 11

    Please check the above MR.

  • Status changed to Needs work 10 months ago
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom joachim

    This is not the right way to fix this.

    As I said above, we need to understand why the wrong value is arriving here, not just paper around it.

    (Also, please be careful with whitespace when making changes.)

Production build 0.71.5 2024