- Issue created by @wouter.h
- 🇧🇪Belgium wouter.h
My solution ensures that in the "strReplaceFirst" function it specifically searches for a URL alias that starts with a part instead of the first occurring part in the URL.
private function strReplaceFirst(string $search, string $replace, string $subject) { if(str_starts_with($subject, $search)) { $pos = strpos($subject, $search); if ($pos !== false) { return substr_replace($subject, $replace, $pos, strlen($search)); } } return $subject; }
After checking, I notice that it no longer replaces the news part of the "facets_pretty_paths" module, but the effective first part of the URL remains untranslated.
"/search/type/news" should be "/search/type/news"
After removing the "break;" in the "getOutboundPath" function everything works as expected
- Issue was unassigned.
- Status changed to Needs review
23 days ago 1:28pm 22 April 2025 - 🇳🇴Norway steinmb
I am guessing you would like some feedback on this patch from the maintainers. To make increase changes for it to be merged you should consider changing it to a MR (merge request).
- 🇧🇪Belgium tim-diels Belgium 🇧🇪
Hi Wouter, thanks for the report and the patch. Could you see if 🐛 When there's a path that is a subpath of trans_path, the getOutboundPath function messes up paths from other places Active fixes the issue? If not, you can use it as base to create a test that fails and then a fix?