Inherits beta evaluation from parent issue: #2367749: Remove usage of deprecated UrlGeneratorInterface::generateFromPath()
Problem/Motivation
UrlGeneratorInterface::generateFromPath() is deprecated for removal before Drupal 8.0.0 release.
LanguageSwitchingTest::testLanguageBlockWithDomain() calls UrlGeneratorInterface::generateFromPath() with a path instead of using a route name.
There might be other instances in the language module where UrlGeneratorInterface::generateFromPath() is used.
These should all be removed.
Proposed resolution
Fix by changing the method call to generateFromRoute() with a route name and parameters
Remaining tasks
User interface changes
n/a
API changes
n/a
Contributor tasks needed
| Task |
Novice task? |
Contributor instructions |
Complete? |
Comments
Comment #2
mile23Comment #3
sdstyles commentedComment #4
sdstyles commentedPassed language parameter as option.
Comment #6
mile23If you look at the failing test, you'll see that it failed because it threw an exception:
Symfony\Component\Routing\Exception\RouteNotFoundException: Route "user/2" does not exist. in Drupal\Core\Routing\RouteProvider->getRouteByName() (line 193 of /var/lib/drupaltestbot/sites/default/files/checkout/core/lib/Drupal/Core/Routing/RouteProvider.php). Drupal\Core\Routing\RouteProvider->getRouteByName('user/2') Drupal\Core\Routing\UrlGenerator->getRoute('user/2') Drupal\Core\Routing\UrlGenerator->generateFromRoute('user/2', Array, Array, 1) Drupal\Core\Render\MetadataBubblingUrlGenerator->generateFromRoute('user/2', Array) Drupal\language\Tests\LanguageSwitchingTest->testLanguageBlockWithDomain() Drupal\simpletest\TestBase->run(Array) simpletest_script_run_one_test('596', 'Drupal\language\Tests\LanguageSwitchingTest')This tells you that there's no *route* named 'user/2'.
generateFromRoute()requires a route name, not a path.Comment #8
sdstyles commentedChanged path with route and fixed typo.
Comment #9
mile23Nice.
Applies, passes tests, and is needed for a deprecation before the 8.0.0 release.
See the parent issue for beta evaluation: #2367749: Remove usage of deprecated UrlGeneratorInterface::generateFromPath()
Comment #10
alexpotttbh all the simple
UrlGeneratorInterface::generateFromPath()could have been done in one usages.Committed f3f3efa and pushed to 8.0.x. Thanks!