Skip to content

Commit

Permalink
Item9790: Bulk register should accept real table headin
Browse files Browse the repository at this point in the history
Strip out html markup.  Wiki markup is stripped from the next option:

Also, it was not working for fields like 'InstantMessaging (IM)',  so
call the standard form title processor to recover a field name.
  • Loading branch information
gac410 committed Feb 29, 2016
1 parent d974f87 commit 7520273
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions TopicUserMappingContrib/data/System/BulkRegistration.txt
@@ -1,4 +1,4 @@
%META:TOPICINFO{author="ProjectContributor" comment="" date="1456631653" format="1.1" version="1"}%
%META:TOPICINFO{author="ProjectContributor" comment="" date="1456768091" format="1.1" version="1"}%
%META:TOPICPARENT{name="AdminToolsCategory"}%
---+ Bulk Registration

Expand Down Expand Up @@ -55,7 +55,7 @@ The following should be inserted into your %REGISTERTOPIC% as a table. This is t
*Usage:*
1 Copy this text to your clipboard
1 Click through and paste this on %REGISTERTOPIC%.
1 Add and customize entries, save table. Note that the first row must not contain bolded entries, so don't apply any formatting.
1 Add and customize entries, save table.
1 Return here

#CustomizingUserData
Expand Down
3 changes: 3 additions & 0 deletions core/lib/Foswiki/UI/Register.pm
Expand Up @@ -16,6 +16,7 @@ use Assert;
use Error qw( :try );

use Foswiki ();
use Foswiki::Form ();
use Foswiki::LoginManager ();
use Foswiki::OopsException ();
use Foswiki::Sandbox ();
Expand Down Expand Up @@ -395,6 +396,8 @@ sub bulkRegister {
else {
foreach my $field ( split( /\s*\|\s*/, $1 ) ) {
$field =~ s/^[\s*]*(.*?)[\s*]*$/$1/;
$field =~ s/<.*?>//g; #strip any html markup from heading
$field = Foswiki::Form::fieldTitle2FieldName($field);
push( @fields, $field );
}
$gotHdr = 1;
Expand Down

0 comments on commit 7520273

Please sign in to comment.