Closed FlipZoomMedia closed 4 days ago
@FlipZoomMedia I can't seem to duplicate here yet. Can you spot anything I'm missing? I updated my InputfieldPageName module config to set .=
in the character replacements. Then I used this code to test:
$a = [
'without dot: ' => 'demo åöü without dot',
'with dot: ' => 'demo åöü with . dot',
];
echo "<table>";
foreach($a as $k => $v) {
echo "<tr><td>pageNameTranslate $k</td><td>" . $sanitizer->pageNameTranslate($v) . "</td></tr>";
echo "<tr><td>pageName $k</td><td>" . $sanitizer->pageName($v, Sanitizer::translate) . "</td></tr>";
}
echo "</table>";
and here's the result I got:
@ryancramerdesign - while you're in this part of the core, any chance of looking at this one: https://github.com/processwire/processwire-issues/issues/1344
and also revisiting the inconsistency issue I note in my final comment on this one: https://github.com/processwire/processwire-issues/issues/1305
@FlipZoomMedia I can't seem to duplicate here yet. Can you spot anything I'm missing? I updated my InputfieldPageName module config to set
.=
in the character replacements. Then I used this code to test:$a = [ 'without dot: ' => 'demo åöü without dot', 'with dot: ' => 'demo åöü with . dot', ]; echo "<table>"; foreach($a as $k => $v) { echo "<tr><td>pageNameTranslate $k</td><td>" . $sanitizer->pageNameTranslate($v) . "</td></tr>"; echo "<tr><td>pageName $k</td><td>" . $sanitizer->pageName($v, Sanitizer::translate) . "</td></tr>"; } echo "</table>";
and here's the result I got:
Hi @ryancramerdesign,
I also get empty results with your example. 🤷♂️
If I remove .=
from the config, it works without any problems. I'm not quite sure how to debug further. The installations have a lot of modules, but I don't think they have any direct influence or use hooks in that area.
screencast-stage.flipzoom.de-2024.07.05-16_49_32.webm
I list mall modules here. I'll have to try this on a fresh PW installation. Unfortunately I can't do it anymore today.
Server Details
Software | Version |
---|---|
ProcessWire | 3.0.229 |
PHP | 8.3.8 |
Webserver | Apache |
MySQL Server | 10.3.39-MariaDB |
MySQL Client | mysqlnd 8.3.8 |
@FlipZoomMedia Do you have $config->pageNameCharset
set to something in your /site/config.php file? (default is ascii
). If you have it set to UTF8 then check if you are also overriding the $config->pageNameWhitelist
value?
Do you have the LanguageSupport modules installed or not installed?
Hi @ryancramerdesign, I just tested it again with a completely fresh installation. Only TracyDebugger is installed, otherwise PW Main 3.0.229 and the Blank Profile. Same problem:
@FlipZoomMedia Do you have
$config->pageNameCharset
set to something in your /site/config.php file? (default isascii
). If you have it set to UTF8 then check if you are also overriding the$config->pageNameWhitelist
value?Do you have the LanguageSupport modules installed or not installed?
No, none of the configurations mentioned. All default. In one installation the LanguageSupport modules are installed, in the fresh installation they are not.
@FlipZoomMedia Just found out that I made a mistake. Too many windows open and it looks like I added .=
to a different installation than the one I was testing. Sorry about that. I'm going to re-try here.
@FlipZoomMedia I was able to duplicate it after correcting my mistake. I've refactored that part of the code a bit, which seems to fix it. Thanks.
Thank you, the fix works.
There is a problem with the sanitizer methods:
insofar as the dot is configured in the "InputfieldPageName" module so that the dot is not allowed (the dot is replaced by nothing; this is necessary for specific bug with the ProCache buster method C and path versioning).
This means that if the string contains a dot, nothing is returned. It should actually be the case that the dot is simply removed and the rest of the string is returned.
Setup/Environment