Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Updated: Comment #0
Problem/Motivation
Some classes in Path subsystem have strange naming conventions. We should re-think this and make naming more clear and logic.
This issue is dependent on #2199381: Add \Drupal\Core\Path\PathInterface.
Proposed resolution
Remaining tasks
- identify classes that need to be fixed
- discuss new naming conventions
- implement renaming
User interface changes
N/A
API changes
Some classes will be renamed.
Comment | File | Size | Author |
---|---|---|---|
#27 | 2208631_27.patch | 540 bytes | slashrsm |
#21 | 2208631_21.patch | 28.24 KB | slashrsm |
#18 | interdiff.txt | 12.84 KB | slashrsm |
#18 | 2208631_18.patch | 28.14 KB | slashrsm |
#12 | 2208631_12.patch | 15.9 KB | slashrsm |
Comments
Comment #1
BerdirComment #2
slashrsm CreditAttribution: slashrsm commentedI would suggest "Path" and "PathInterface" to be renamed to "AliasStorageController" and "AliasStorageControllerInterface".
I believe this is already becoming a storage controller and it will become even more if #2209145: Move all path alias SQL queries to a single storage controller moves forward. Also, I think this service is not so much about path as it is about aliases (it takes care about storing aliases into storage back-end).
Comment #3
slashrsm CreditAttribution: slashrsm commentedComment #5
sunSounds good to me.
@slashrsm, can you configure your git to use renames=copies, please, so we can properly review the changes in the renamed class file? See https://drupal.org/node/1542048
Comment #6
BerdirI would suggest to *not* name them StorageController. See #2188613: Rename EntityStorageController to EntityStorage. Just leave away the Controller part.
Comment #7
slashrsm CreditAttribution: slashrsm commentedShould install now. Renamed as suggested in #6 and configured my .gitconfig as suggested in #5.
Comment #8
slashrsm CreditAttribution: slashrsm commentedComment #9
dawehnerAwesome!
Comment #10
alexpottWhy not rename the service too then?
Let's create the promised AliasStorageInterface from the issue summary and use it :)
Comment #11
slashrsm CreditAttribution: slashrsm commentedAgree. I think it would make sense to rename all alias related services to go along the naming conventions we're planning with #2002126: [meta] Refactor the alias subsystem (classes in \Drupal\Core\Path) (use "path" for non-aliased URL and "alias" part). It makes sense to do this in one patch (possibly together with renaming in the other places).
Interface is added in #2199381: Add \Drupal\Core\Path\PathInterface. Should we merge them?
Comment #12
slashrsm CreditAttribution: slashrsm commented#2199381: Add \Drupal\Core\Path\PathInterface has landed. Reroll uses interface instead of the class directly.
Comment #13
miro_dietikerCode in #12 looks great. Still any remaining action items from #11?
Comment #14
slashrsm CreditAttribution: slashrsm commentedThere is a renaming question left. Do we rename path service here or in a patch that will consolidate all naming related to aliases (see parent issue summary for more info).
Comment #15
sunIn case the service is cleanly injected everywhere, that should only affect some .services.yml files, right? If so, let's do right in here? :)
Comment #16
dawehnerWell ... sadly we do have plugins and controllers.
Comment #17
miro_dietikerdawehner, please be more specific about what needs fixing or what is wrong, explicitly.
You just provided a statement.
Comment #18
slashrsm CreditAttribution: slashrsm commentedComment #19
dawehnerEhem, the neeeds work was not intended. My comment was just for sun.
Comment #20
alexpottHmmm... but the alias storage can not be used for storing other types of aliases. How about
path.alias_storage
which matches up nicely withpath.alias_manager
Comment #21
slashrsm CreditAttribution: slashrsm commentedComment #22
sunThanks for the quick turnaround, @slashrsm!
I agree with @alexpott's suggestion, that's a much more sane naming :)
Comment #23
alexpottCommitted 719b36a and pushed to 8.x. Thanks!
Huh? I excluded core/core.services.yml.orig when I applied the patch.
Comment #25
alexpottPlease update the https://drupal.org/node/1853148 change record.
Comment #26
slashrsm CreditAttribution: slashrsm commentedDone: https://drupal.org/node/1853148/revisions/view/2842887/7101305
Comment #27
slashrsm CreditAttribution: slashrsm commentedOne service name change sneaked out of the patch...
Comment #28
alexpottYeah this lead me to #2232391: Revert drupal 8 changes made to generate-d7-content.sh and generate-d6-content.sh
Comment #29
slashrsm CreditAttribution: slashrsm commentedAh... forget this! I guess it is to early for my brain....