Problem/Motivation
Drupal\Core\Routing\UrlGeneratorInterface::generateFromPath() is marked as deprecated before the 8.0.0 release.
In order to remove it, we must remove usages of it.
Proposed resolution
Remove usages of Drupal\Core\Routing\UrlGeneratorInterface::generateFromPath().
From the generateFromPath() docblock:
* @deprecated in Drupal 8.0.x-dev and will be removed before Drupal 8.0.0.
* To generate URLs for Drupal routes (that is, most pages generated by
* Drupal), see UrlGeneratorInterface::generateFromRoute() instead. For
* non-routed local URIs relative to the base path (like robots.txt) see
* \Drupal\Core\Utility\UnroutedUrlAssembler.
UroutedUrlAssembler is a service:
unrouted_url_assembler:
class: Drupal\Core\Utility\UnroutedUrlAssembler
arguments: ['@request_stack', '@path_processor_manager', '%filter_protocols%']
See child issues for ongoing list of removals.
Remaining tasks
Need to identify each usage here and create sub tasks for each. Check for duplicate issues.
User interface changes
API changes
Original report by @gumanist
Contributor tasks needed
| Task |
Novice task? |
Contributor instructions |
Complete? |
Beta phase evaluation
Comments
Comment #1
gumanist commentedComment #2
mirom commentedComment #3
mirom commentedComment #4
Palashvijay4O commentedComment #5
chx commentedI would be much less hasty with this one cos #2339219: [meta] Finalize URL generation API (naming, docs, deprecation)
Comment #6
Palashvijay4O commentedComment #7
pwolanin commented@chx - we should still do it?
Let's identify each and make sub-tasks.
Comment #8
pwolanin commentedComment #9
ianthomas_ukPostponing on #2339219: [meta] Finalize URL generation API (naming, docs, deprecation). This might be novice later, but it isn't at the moment.
Comment #10
mile23UrlGeneratorInterface::generateFromPath() seems to be used 32 times in core.
Is it really deprecated?
Comment #11
pwolanin commentedYes, all but one or 2 of those uses can be removed. It's really deprecated, don't use it.
Comment #12
pwolanin commentedComment #13
pwolanin commentedCreated 2 sub-bugs for usages easy to remove that are not in tests. A lot of the ones in tests could be removed also very easily.
The only one not immediately removable is in RedirectResponseSubscriber::getDestinationAsAbsoluteUrl(), but possibly that can be fixed using the Url class.
Comment #14
mile23Ah nice, they're child issues. Thanks.
Comment #15
mile23Updated issue summary.
Comment #16
mile23Comment #17
mile23Comment #18
ianthomas_ukAll child issues fixed and no references to generateFromPath left in the codebase
Comment #19
dawehnerNice work!