All does is clear caches, there is no reason that path.module shouldn't just do that itself?

Not even sure that is still necessary, let's see what happens if I just remove it.

Comments

berdir’s picture

Ah, 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.

swentel’s picture

Status: Active » Needs review
StatusFileSize
new1.51 KB

There's a todo in AliasStorage, but not sure if there's an issue.

@todo Switch to using an event for this instead of a hook.

But yes, this in system doesn't make any sense, moving them seems weird to because of the function names.

berdir’s picture

Hm. 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 ;)

berdir’s picture

Forgot to actually write that we can't just move them, because path.module is optional and this code needs to fire all the time.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

jhedstrom’s picture

Status: Needs review » Needs work
Issue tags: +Needs reroll

Patch no longer applies.

rajeshwari10’s picture

Status: Needs work » Needs review
StatusFileSize
new2.61 KB

Rerolling the patch.

Thanks!!

Status: Needs review » Needs work

The last submitted patch, 7: 2331781-7.patch, failed testing.

rajeshwari10’s picture

Status: Needs work » Needs review
StatusFileSize
new2.53 KB

rerolling patch.

Thanks!!

Status: Needs review » Needs work

The last submitted patch, 9: 2331781-9.patch, failed testing.

sergeimalyshev’s picture

Version: 8.1.x-dev » 8.2.x-dev
Status: Needs work » Needs review
Issue tags: -Needs reroll
StatusFileSize
new1.97 KB

Status: Needs review » Needs work

The last submitted patch, 11: 2331781-11.patch, failed testing.

sergeimalyshev’s picture

StatusFileSize
new2.48 KB
sergeimalyshev’s picture

Status: Needs work » Needs review
Issue tags: +Needs reroll
StatusFileSize
new2.48 KB

Status: Needs review » Needs work

The last submitted patch, 14: 2331781-14.patch, failed testing.

andypost’s picture

Issue tags: -Needs reroll

Probably 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

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 9.1.x-dev » 9.2.x-dev

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

quietone’s picture

Status: Needs work » Closed (duplicate)
Related issues: +#2336597: Convert path aliases to full featured entities

Correct me if I am wrong, this looks like it was fixed in #2336597: Convert path aliases to full featured entities. Closing as a duplicate.

berdir’s picture

That 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.