Argument 2 function must be an instance....

Created on 24 July 2016, over 8 years ago
Updated 29 March 2023, almost 2 years ago

PHP 5.6 , Drupal 8.1.3 core

Thought I would test it out with Drupal RPG.... for the most part everything does well with the modules within.... but the main module in its root folder.... causes an error.... I am using the 8.1.dev version of dmu.

/opt/lampp/htdocs/social83/modules/drpg$ drush dmu-upgrade --path=modules/drpg drpg
Indexing...done.
Argument 2 passed to [error]
Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBindingFactory::create()
must be an instance of
Drupal\drupalmoduleupgrader\Routing\Drupal8\RouteWrapper, null given,
called in
/opt/lampp/htdocs/social83/modules/drupalmoduleupgrader/src/Plugin/DMU/Converter/Links.php
on line 92 and defined LinkBindingFactory.php:34
E_RECOVERABLE_ERROR encountered; aborting. To ignore recoverable [error]
errors, run again with --no-halt-on-error
Drush command terminated abnormally due to an unrecoverable error. [error]

πŸ› Bug report
Status

Needs work

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States Shaun Holt

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.

  • πŸ‡¨πŸ‡¦Canada earthangelconsulting

    this is not working for me, i am getting the same error as the original poster.

    i am trying to run version 8.x-1.9 of this module, on Drupal 9.5.0, php 7.4.33, Drush 8.4.6
    (8.x-1.x-dev is identical to 8.x-1.9 at this time)

    here's the stack trace:

    >drush dmu-upgrade registration_type
    Indexing...done.
    Use of undefined constant MENU_DEFAULT_LOCAL_TASK - assumed          [warning]
    'MENU_DEFAULT_LOCAL_TASK' (this will throw an Error in a future
    version of PHP) HookMenu.php(73) : eval()'d code:14
    Use of undefined constant MENU_LOCAL_ACTION - assumed                [warning]
    'MENU_LOCAL_ACTION' (this will throw an Error in a future version of
    PHP) HookMenu.php(73) : eval()'d code:22
    Use of undefined constant MENU_DEFAULT_LOCAL_TASK - assumed          [warning]
    'MENU_DEFAULT_LOCAL_TASK' (this will throw an Error in a future
    version of PHP) HookMenu.php(73) : eval()'d code:14
    Use of undefined constant MENU_LOCAL_ACTION - assumed                [warning]
    'MENU_LOCAL_ACTION' (this will throw an Error in a future version of
    PHP) HookMenu.php(73) : eval()'d code:22
    TypeError: Argument 2 passed to                                      [error]
    Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBindingFactory::create()
    must be an instance of
    Drupal\drupalmoduleupgrader\Routing\Drupal8\RouteWrapper, null given,
    called in
    /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Links.php
    on line 90 in
    Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBindingFactory->create()
    (line 34 of
    /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/src/Routing/LinkBinding/LinkBindingFactory.php)
    #0
    /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Links.php(90):
    Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBindingFactory->create(Object(Drupal\drupalmoduleupgrader\Routing\Drupal7\RouteWrapper),
    NULL)
    #1
    /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc(352):
    Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Links->convert(Object(Drupal\drupalmoduleupgrader\Target))
    #2 phar:///usr/local/bin/drush/includes/command.inc(422):
    drush_drupalmoduleupgrader_dmu_upgrade('registration_ty...')
    #3 phar:///usr/local/bin/drush/includes/command.inc(231):
    _drush_invoke_hooks(Array, Array)
    #4 phar:///usr/local/bin/drush/includes/command.inc(199):
    drush_command('registration_ty...')
    #5 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67):
    drush_dispatch(Array)
    #6 phar:///usr/local/bin/drush/includes/preflight.inc(67):
    Drush\Boot\BaseBoot->bootstrap_and_dispatch()
    #7 phar:///usr/local/bin/drush/includes/startup.inc(465):
    drush_main()
    #8 phar:///usr/local/bin/drush/includes/startup.inc(369):
    drush_run_main(false, '/', 'Phar detected. ...')
    #9 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
    #10 /usr/local/bin/drush(10): require('phar:///usr/loc...')
    #11 {main}.
    TypeError: Argument 2 passed to Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBindingFactory::create() must be an instance of Drupal\drupalmoduleupgrader\Routing\Drupal8\RouteWrapper, null given, called in /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Links.php on line 90 in /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/src/Routing/LinkBinding/LinkBindingFactory.php on line 34 #0 /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Links.php(90): Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBindingFactory->create(Object(Drupal\drupalmoduleupgrader\Routing\Drupal7\RouteWrapper), NULL)
    #1 /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/drupalmoduleupgrader.drush.inc(352): Drupal\drupalmoduleupgrader\Plugin\DMU\Converter\Links->convert(Object(Drupal\drupalmoduleupgrader\Target))
    #2 phar:///usr/local/bin/drush/includes/command.inc(422): drush_drupalmoduleupgrader_dmu_upgrade('registration_ty...')
    #3 phar:///usr/local/bin/drush/includes/command.inc(231): _drush_invoke_hooks(Array, Array)
    #4 phar:///usr/local/bin/drush/includes/command.inc(199): drush_command('registration_ty...')
    #5 phar:///usr/local/bin/drush/lib/Drush/Boot/BaseBoot.php(67): drush_dispatch(Array)
    #6 phar:///usr/local/bin/drush/includes/preflight.inc(67): Drush\Boot\BaseBoot->bootstrap_and_dispatch()
    #7 phar:///usr/local/bin/drush/includes/startup.inc(465): drush_main()
    #8 phar:///usr/local/bin/drush/includes/startup.inc(369): drush_run_main(false, '/', 'Phar detected. ...')
    #9 phar:///usr/local/bin/drush/drush(114): drush_startup(Array)
    #10 /usr/local/bin/drush(10): require('phar:///usr/loc...')
    #11 {main}
    TypeError: Argument 2 passed to Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBindingFactory::create() must be an instance of Drupal\drupalmoduleupgrader\Routing\Drupal8\RouteWrapper, null given, called in /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/src/Plugin/DMU/Converter/Links.php on line 90 in Drupal\drupalmoduleupgrader\Routing\LinkBinding\LinkBindingFactory->create() (line 34 of /home/foobar/public_html/ea.foobar.com/web/modules/contrib/drupalmoduleupgrader/src/Routing/LinkBinding/LinkBindingFactory.php).
    Drush command terminated abnormally due to an unrecoverable error.   [error]
    
  • πŸ‡­πŸ‡ΊHungary GΓ‘bor Hojtsy Hungary

    The patch just kicks the can down the line, since the lower levels also require the route object. Why is not the route object there should be the question, so going up the chain instead of down would be better. This is where the link binding factory is called and looks like the getDestinationRoute does not return a valid route for the path?

    $binding = $this->linkBinding->create($source, $hook_menu->getDestinationRoute($path));
    

    This could be related to the undefined menu constants problem reported earlier, depending on how the code reacts to that.

Production build 0.71.5 2024