Updated: Comment #0
Problem/Motivation
There are 4 path alias lookup functions in AliasManager (getSystemPath(), lookupPathSource(), getPathALias(), lookupPathAlias()), which can be partly merged and cleaned up.
We are also simplifying path alias related terminology, which should be considered while working on this ticket. See parent issue for more info about that aspect.
Proposed resolution
- merge getSystemPath() and lookupPathSource() into getPathByAlias()
- merge getPathALias() and lookupPathAlias() into getAliasByPath()
Remaining tasks
- code it
- test it
User interface changes
N/A
API changes
- getSystemPath() renamed to getPathByAlias()
- getPathALias() renamed to getAliasByPath()
Comments
Comment #1
slashrsm commentedComment #2
cs_shadow commentedComment #3
slashrsm commentedHere we go...
Comment #4
marcingy commentedThere should be () round the $path assignment
Need types
so
@param string etc.....also for return
Same for doxygen of
Over 80 characters
Same with
Comment #5
slashrsm commentedThanks! Uploading fixed patch.
Comment #6
marcingy commentedLooks good
Comment #7
slashrsm commentedComment #9
slashrsm commentedRe-roll
Comment #10
slashrsm commentedThis was a straight re-roll.
Comment #11
slashrsm commented9: 2233619_9.patch queued for re-testing.
Comment #13
slashrsm commentedReroll.
Comment #14
marcingy commentedlooks good
Comment #15
xjmWill these change records need updates?
https://drupal.org/node/1853148
https://drupal.org/node/2221879
If so, let's update them to add a reference to this issue so that they show up in the sidebar here, and change the method names appropriately once the issue is fixed.
Comment #16
slashrsm commentedDone.
@xjm: There is also #2233623: Merge AliasManagerCacheDecorator into AliasManager in the same set, which is waiting for this to go in. Should we also add that one to same change records?
Comment #17
xjm@slashrsm, good idea.
Comment #19
Jalandhar commentedUpdating re-rolled patch.
Comment #20
slashrsm commentedThis was a straight re-roll.
Comment #21
catchShouldn't this happen before the pre-load of paths by language? Seems like it could avoid getting the cache entry at all in some situations.
The other changes look good.
Related is #2248897: Fix AliasManager and AliasManagerCacheDecorator, the better naming here might have avoided that bug.
Comment #22
xjmJust a reminder that the change records linked in the sidebar will need updates when this goes in. Thanks!
Comment #23
slashrsm commentedComment #24
slashrsm commented@catch: there is also #2233623: Merge AliasManagerCacheDecorator into AliasManager as part of #2002126: [meta] Refactor the alias subsystem (classes in \Drupal\Core\Path). I'm planning to work on that when this goes in.
Comment #26
slashrsm commentedFix and re-roll after #1987802: Convert path_admin_overview() to a new style controller;
Comment #28
slashrsm commentedAnother function call converted.
Comment #29
catchThose changes look good, back to RTBC.
Comment #30
alexpottSince we're changing $path_language to $language let's actually pick a better name - it should be changed to $langcode since that is what it is.
Comment #31
slashrsm commentedComment #32
slashrsm commentedComment #33
alexpottCommitted 1299c3a and pushed to 8.x. Thanks!
Renamed the
languagePreloadedtolangcodePreloadedComment #35
slashrsm commentedChange notice updated: https://drupal.org/node/1853148/revisions/view/7175609/7211479
Comment #36
slashrsm commented