Item14415: TopicUserMapping places non-ASCII users in wrong position in WikiUsersTopic.
Priority: Normal
Current State: Closed
Released In: 2.1.5
Target Release: patch
It doesn't use NFKD normalization when searching for the point to insert the name. For example, with some tests registrations:
Also, the
FAQRebuildingWikiUsersTopic skips users with non-A-Z first character.
Probably best to just drop the A-Z index, at least when rebuilding the topic using the FAQ. It's a convenience, not operational.
--
GeorgeClark - 07 Jun 2017
Somewhat related, a non-wikiword user will break the list. All inserts occur ahead of the non-wikiword. Should not happen, but it could, for ex after a topic rename.
--
GeorgeClark - 30 Sep 2017
I think that the following would fix the case of a username not being a wikiword.
diff --git a/TopicUserMappingContrib/lib/Foswiki/Users/TopicUserMapping.pm b/TopicUserMappingContrib/lib/Foswiki/Users/TopicUserMapping.pm
index 576cd84..8b7f6f2 100755
--- a/TopicUserMappingContrib/lib/Foswiki/Users/TopicUserMapping.pm
+++ b/TopicUserMappingContrib/lib/Foswiki/Users/TopicUserMapping.pm
@@ -398,7 +398,7 @@ sub _maintainUsersTopic {
if ($entry) {
my ( $web, $name, $odate ) = ( '', '', '' );
if ( $line =~
-m/^\s+\*\s($Foswiki::regex{webNameRegex}\.)?($Foswiki::regex{wikiWordRegex})\s*(?:-\s*\w+\s*)?-\s*(.*)/
+m/^\s+\*\s($Foswiki::regex{webNameRegex}\.)?($Foswiki::regex{webNameBaseRegex})\s*(?:-\s*\w+\s*)?-\s*(.*)/
)
{
$web = $1 || $Foswiki::cfg{UsersWebName};
Though this code is still rather fragile. If a user is renamed, it would cause the list to be out of order, and insertions would end up in the wrong place. Rather than a line-by-line search and positional insert, it might be better to read the whole list in, add the new entry, and then sort & write it back out. This would also correct out-of-place entries caused by user rename.
--
GeorgeClark - 14 Oct 2017
Keeping this fix in 2.1.5. Defer any more forgiving regex work for 2.2
--
GeorgeClark - 16 Oct 2017