Closed (duplicate)
Project:
Drupal core
Version:
9.2.x-dev
Component:
system.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Sep 2014 at 22:29 UTC
Updated:
13 May 2021 at 09:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
berdirAh, so while those hooks are documented in path.module, they are not specific to it but they're in core, so we should move them there.
This was recently added in #2126421: Decouple \Drupal\Core\Path\AliasManager and \Drupal\Core\Path\Path, and using system.module for this is... ugh.
I'm not sure what to do, seems to me like using a hook for the cache clearing there is super weird.
In many places we now use cache tags for this. although that only works for persistent caching. And speaking of that, the cache clear in clearCache() seems very wrong, because it just clears the current cacheKey, but that's just for the current path, what about others? Seems like we need a cache tag for all path alias caches?
An easy way would be to make the alias manager handle CRUD changes, then he can clear caches himself.
Comment #2
swentel commentedThere's a todo in AliasStorage, but not sure if there's an issue.
But yes, this in system doesn't make any sense, moving them seems weird to because of the function names.
Comment #3
berdirHm. While every line of code in system.module is annoying, I fear the only bug right now is that path.api.php is in path.module and not system.module.
@slashrsm is currently having a try at making aliases entities. I'm not fully convinced yet, but it would a) mean that those are suddenly entity hooks and b), the event @todo is history ;)
Comment #4
berdirForgot to actually write that we can't just move them, because path.module is optional and this code needs to fire all the time.
Comment #6
jhedstromPatch no longer applies.
Comment #7
rajeshwari10 commentedRerolling the patch.
Thanks!!
Comment #9
rajeshwari10 commentedrerolling patch.
Thanks!!
Comment #11
sergeimalyshev commentedComment #13
sergeimalyshev commentedComment #14
sergeimalyshev commentedComment #16
andypostProbably this cache clear should be moved into the service itself but this will cause a circular dependency
So only event can help here...
Suppose we just need to add docs about why this lives and should stay in system module
Comment #26
quietone commentedCorrect me if I am wrong, this looks like it was fixed in #2336597: Convert path aliases to full featured entities. Closing as a duplicate.
Comment #27
berdirThat issue just converted it to system_path_alias_insert(), but afterwards the path alias system was moved into the path_alias module, so yes, this is indeed a duplicate of those two and done.