Updated: Comment #0
Problem/Motivation
path_load() is procedural wrapper around \Drupal::service('path.alias_storage')->load($conditions), which is used on one single place in the entire core.
Proposed resolution
Let's kill path_load() and just use service directly instead.
Remaining tasks
- code it
- test it
User interface changes
N/A
API changes
- path_load() is gone and \Drupal::service('path.alias_storage')->load($conditions) should be used instead.
Comment | File | Size | Author |
---|---|---|---|
#16 | node-2233607-16.patch | 1.53 KB | visabhishek |
#13 | node-2233607-13.patch | 1.59 KB | visabhishek |
#13 | interdiff-2233607-11-13.txt | 672 bytes | visabhishek |
#11 | node-2233607-11.patch | 1.74 KB | visabhishek |
#11 | interdiff-2233607-08-11.txt | 1.33 KB | visabhishek |
Comments
Comment #1
visabhishek CreditAttribution: visabhishek commentedComment #2
visabhishek CreditAttribution: visabhishek commentedi have created a patch please review
Comment #3
slashrsm CreditAttribution: slashrsm commentedpath_load() needs to be removed.
Comment #4
visabhishek CreditAttribution: visabhishek commentedpatch updated as per #3.
Comment #7
visabhishek CreditAttribution: visabhishek commentedi think we have to add follwing code from path_load() to avoid exceptions.
Comment #8
visabhishek CreditAttribution: visabhishek commentedSorry i have uploaded wrong patch. Now i am uploading correct one
Comment #9
slashrsm CreditAttribution: slashrsm commentedI'd rather see this being fixed when called (PathController::adminEdit()) instead of here.
Comment #10
marcingy CreditAttribution: marcingy commentedWhen the function in question calls path_load it always provides a pid. So if you set the condition you pass in to be a pid that should solve the issue. The else statements are from a time when path load was called by more areas in the code.
Comment #11
visabhishek CreditAttribution: visabhishek commentedi have updated patch as per #9.
Comment #12
slashrsm CreditAttribution: slashrsm commentedAs @marcingy already mentioned in #10 you don't need to support all 3 conditions. Just the first if should do just fine in here...
Comment #13
visabhishek CreditAttribution: visabhishek commentedi have updated patch as per #12.
Comment #14
slashrsm CreditAttribution: slashrsm commentedWhy not simply:
Comment #16
visabhishek CreditAttribution: visabhishek commented@slashrsm: ok , i am updating the patch again.
Comment #17
slashrsm CreditAttribution: slashrsm commentedLooks good. Note that #2233595: Deprecate the custom path alias storage kind of depends on this and it will need a re-roll when this gets in.
Comment #18
alexpottWe need update the https://drupal.org/node/1853148 change notice.
Committed 2ccfe55 and pushed to 8.x. Thanks!