Upon trying to enable Salesforce 8.x-3.3 I get the following error:

Fatal error: Uncaught Error: Call to a member function getPath() on null in /var/www/html/core/modules/config_translation/src/ConfigNamesMapper.php:247
Stack trace:
#0 /var/www/html/core/modules/config_translation/src/Routing/RouteSubscriber.php(39): Drupal\config_translation\ConfigNamesMapper->getOverviewRoute()
#1 /var/www/html/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\config_translation\Routing\RouteSubscriber->alterRoutes(Object(Symfony\Component\Routing\RouteCollection))
#2 [internal function]: Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /var/www/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))
#4 /var/www/html/core/lib/Drupal/Core/Routing/RouteBuil in /var/www/html/core/modules/config_translation/src/ConfigNamesMapper.php on line 247

I uninstalled the module, and installed 8.x-4.x with no error, which leads me to believe its an error specifically for this version.

Comments

TJPope created an issue. See original summary.

gcheval’s picture

There are missing routes in the module. I have been able to authenticate my website by adding missing routes from https://git.drupalcode.org/project/salesforce/raw/8.x-4.x/salesforce.rou... and point the salesforce.auth_config toward the \Drupal\salesforce\Form\AuthorizeForm class.

  • AaronBauman committed 7850880 on 8.x-3.x
    Issue #3058246: Call to a member function getPath() on null when...
aaronbauman’s picture

Version: 8.x-3.3 » 8.x-3.x-dev
Status: Active » Fixed

Should be fixed for 3.x-dev now, can you please confirm?

tjpope’s picture

Tried installing 3.x-dev and enabling salesforce and I get these errors:

Error: Call to a member function getPath() on null in /var/www/html/core/modules/config_translation/src/ConfigNamesMapper.php on line 247 #0 /var/www/html/core/modules/config_translation/src/Routing/RouteSubscriber.php(39): Drupal\config_translation\ConfigNamesMapper->getOverviewRoute()
#1 /var/www/html/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\config_translation\Routing\RouteSubscriber->alterRoutes(Object(Symfony\Component\Routing\RouteCollection))
#2 [internal function]: Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /var/www/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))
#4 /var/www/html/core/lib/Drupal/Core/Routing/RouteBuilder.php(184): Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher->dispatch('routing.route_a...', Object(Drupal\Core\Routing\RouteBuildEvent))
#5 /var/www/html/core/lib/Drupal/Core/ProxyClass/Routing/RouteBuilder.php(83): Drupal\Core\Routing\RouteBuilder->rebuild()
#6 /var/www/html/core/lib/Drupal/Core/Extension/ModuleInstaller.php(322): Drupal\Core\ProxyClass\Routing\RouteBuilder->rebuild()
#7 /var/www/html/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php(83): Drupal\Core\Extension\ModuleInstaller->install(Array, true)
#8 /var/www/vendor/drush/drush/src/Drupal/Commands/pm/PmCommands.php(78): Drupal\Core\ProxyClass\Extension\ModuleInstaller->install(Array, true)
#9 [internal function]: Drush\Drupal\Commands\pm\PmCommands->enable(Array, Array)
#10 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(257): call_user_func_array(Array, Array)
#11 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(212): Consolidation\AnnotatedCommand\CommandProcessor->runCommandCallback(Array, Object(Consolidation\AnnotatedCommand\CommandData))
#12 /var/www/vendor/consolidation/annotated-command/src/CommandProcessor.php(178): Consolidation\AnnotatedCommand\CommandProcessor->validateRunAndAlter(Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#13 /var/www/vendor/consolidation/annotated-command/src/AnnotatedCommand.php(302): Consolidation\AnnotatedCommand\CommandProcessor->process(Object(Symfony\Component\Console\Output\ConsoleOutput), Array, Array, Object(Consolidation\AnnotatedCommand\CommandData))
#14 /var/www/vendor/symfony/console/Command/Command.php(255): Consolidation\AnnotatedCommand\AnnotatedCommand->execute(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /var/www/vendor/symfony/console/Application.php(978): Symfony\Component\Console\Command\Command->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /var/www/vendor/symfony/console/Application.php(255): Symfony\Component\Console\Application->doRunCommand(Object(Consolidation\AnnotatedCommand\AnnotatedCommand), Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /var/www/vendor/symfony/console/Application.php(148): Symfony\Component\Console\Application->doRun(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#18 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(118): Symfony\Component\Console\Application->run(Object(Drush\Symfony\DrushArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#19 /var/www/vendor/drush/drush/src/Runtime/Runtime.php(49): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#20 /var/www/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#21 /var/www/vendor/drush/drush/drush(4): require('/var/www/vendor...')
#22 {main}
Error: Call to a member function getPath() on null in Drupal\config_translation\ConfigNamesMapper->getOverviewRoute() (line 247 of /var/www/html/core/modules/config_translation/src/ConfigNamesMapper.php).

I verified that it was the dev branch that installed and the latest fix was applied but it still errored out. Am I missing something else that I need to add?

aaronbauman’s picture

Status: Fixed » Active

I'll take a closer look sometime today

aaronbauman’s picture

I installed a vanilla drupal site, installed this module via composer, and did not run into this issue.

Can you please explain the exact steps for your install process, and exactly when this error occurs?

tjpope’s picture

Status: Active » Fixed
  1. drush pm:uninstall salesforce
  2. composer clearcache
  3. composer require 'drupal/salesforce:3.x-dev'
  4. drush en salesforce

Then I get all those errors mentioned in #5. If I do a "drush pm:list" I can see it is enabled, but I can't access Salesforce in the UI. If I do a "drush cr" I get these errors:

Fatal error: Uncaught Error: Call to a member function getPath() on null in /var/www/html/core/modules/config_translation/src/ConfigNamesMapper.php:247
Stack trace:
#0 /var/www/html/core/modules/config_translation/src/Routing/RouteSubscriber.php(39): Drupal\config_translation\ConfigNamesMapper->getOverviewRoute()
#1 /var/www/html/core/lib/Drupal/Core/Routing/RouteSubscriberBase.php(37): Drupal\config_translation\Routing\RouteSubscriber->alterRoutes(Object(Symfony\Component\Routing\RouteCollection))
#2 [internal function]: Drupal\Core\Routing\RouteSubscriberBase->onAlterRoutes(Object(Drupal\Core\Routing\RouteBuildEvent), 'routing.route_a...', Object(Drupal\Component\EventDispatcher\ContainerAwareEventDispatcher))
#3 /var/www/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))
#4 /var/www/html/core/lib/Drupal/Core/Routing/RouteBuil in /var/www/html/core/modules/config_translation/src/ConfigNamesMapper.php on line 247
 [warning] Drush command terminated abnormally. Check for an exit() in your Drupal site.

This only happens when salesforce is enabled/installed.

tjpope’s picture

Status: Fixed » Active
aaronbauman’s picture

Status: Active » Needs review
StatusFileSize
new1 KB

gcheval's suggestion was a good one.
Try this patch

tjpope’s picture

Status: Needs review » Active

Patch fixes all the errors. Thanks gcheval and Aaron.

  • AaronBauman committed 533902e on 8.x-3.x
    Issue #3058246 by AaronBauman: Call to a member function getPath() on...
aaronbauman’s picture

Status: Active » Fixed

Patch is in.
Thanks for everyone's help.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.