Bug: The user entry is added at the bottom, not in the user list
When I add a second user, this user is appended at the bottom of the list, not at the beginning letter.
Test case
When I add a second user, this user is appended at the bottom of the list, not at the beginning letter. The word
ListOfWikiNames that is inserted erroneously is only in the TWikiAdminGroup topic. Must be something in there.
--
ArthurClemens - 23 Mar 2005
Arthur is correct. The Dakar code does not insert the new users into the appropriate alphabetical slot, it adds them to the end. However this does not affect any code that makes use of
TWikiUsers. The code isn't smart enough to do binary chop searches on large files :-/
The same problem exists - along with others - when the bulk registration is used.
--
AntonAylward - 24 Mar 2005
Environment
| TWiki version: |
TWikiAlphaRelease |
| TWiki plugins: |
|
| Server OS: |
|
| Web server: |
|
| Perl version: |
|
| Client OS: |
|
| Web Browser: |
|
--
MartinCleaver - 19 Apr 2005
Impact and Available Solutions
Follow up
I am somewhat surprised that this does not work - the testcase functions properly. It does not affect functionality but still annoying. Any insight appreciated - I've checked in an alteration to the testcase (unit/UsersTests.pm -
DevelopReleaseVersion so that it does not delete the file it tests with. Please revert this change to unit/UsersTests.pm if you manage to correct this bug.
--
MartinCleaver - 24 Apr 2005
Fix record
fixed (i hope)
SVN 4340
addUserToTWikiUsersTopic() wasn't taking the letter heading entries into account.
MartinCleaver, i'm going to leave it up to you to restore the tests how you want them (and i'm not sure those tests were of much use if they didn't catch this...

)
Index: Users.pm
===================================================================
--- Users.pm (revision 4339)
+++ Users.pm (working copy)
@@ -252,12 +252,18 @@
foreach my $line ( split( /\r?\n/, $text) ) {
# TODO: I18N fix here once basic auth problem with 8-bit user names is
# solved
- if ( $entry &&
- $line =~ /^\s+\*\s($TWiki::regex{webNameRegex}\.)?($TWiki::regex{wikiWordRegex})\s*(?:-\s*\w+\s*)?-\s*(.*)/ ) {
- my $web = $1 || $TWiki::cfg{UsersWebName};
- my $name = $2;
- my $odate = $3;
- if( $user->wikiName() le $name ) {
+ if ( $entry )
+ {
+ my ( $web, $name, $odate ) = ( '', '', '' );
+ if ( $line =~ /^\s+\*\s($TWiki::regex{webNameRegex}\.)?($TWiki::regex{wikiWordRegex})\s*(?:-\s*\w+\s*)?-\s*(.*)/ ) {
+ $web = $1 || $TWiki::cfg{UsersWebName};
+ $name = $2;
+ $odate = $3;
+ } elsif ( $line =~ /^\s+\*\s([A-Z]) - / ) {
+ # * A - <a name="A">- - - -</a>^M
+ $name = $1;
+ }
+ if( $name && ( $user->wikiName() le $name ) ) {
# found alphabetical position
if( $user->wikiName() eq $name ) {
# adjusting existing user - keep original registration date
--
WillNorris - 30 May 2005
Discussion