Save all valid users, then show a list of invalid users after posting.
Patch by carynb.
diffs (54 lines):
diff -r 7df36af52680 -r 057055a4b0b0 htdocs/manage/circle/edit.bml
--- a/htdocs/manage/circle/edit.bml Tue Aug 11 06:14:27 2009 +0000
+++ b/htdocs/manage/circle/edit.bml Tue Aug 11 17:49:34 2009 +0000
@@ -320,6 +320,9 @@ body<=
# interface, since anyone who's in both the add and edit interfaces
should
# only be proccessed via the add interface and not by the edit
interface
my %userid_processed;
+
+ # Maintain a list of invalid userids for display to the user
+ my @not_user;
# process the additions
foreach my $key ( keys %POST ) {
@@ -328,7 +331,10 @@ body<=
next unless $POST{"editfriend_add_${num}_user"};
my $other_u = LJ::load_user_or_identity(
$POST{"editfriend_add_${num}_user"} );
- next unless $other_u;
+ unless ( $other_u ) {
+ push @not_user, $POST{"editfriend_add_${num}_user"};
+ next;
+ }
my $trusted_nonotify = $u->trusts( $other_u ) ? 1 : 0;
my $watched_nonotify = $u->watches( $other_u ) ? 1 : 0;
@@ -392,7 +398,13 @@ body<=
}
}
- $ret .= "<?h1 $ML{'.success.head'} h1?>";
+ #if there are entries in the not_user array, tell the user there were
problems.
+ if ( @not_user > 0 ) {
+ $ret .= "<?h1 $ML{'.error.adding.header'} h1?>";
+ $ret .= "<br>" . BML::ml('.error.adding.text', { username =>
LJ::ehtml( $_ ) } ) foreach @not_user;
+ } else {
+ $ret .= "<?h1 $ML{'.success.head'} h1?>";
+ }
$ret .= "<?p $ML{'.success.fromhere'} p?>";
$ret .= "<ul>";
$ret .= "<li><a href='" . $u->journal_base .
"/read'>$ML{'.success.friendspage'}</a></li>";
diff -r 7df36af52680 -r 057055a4b0b0 htdocs/manage/circle/edit.bml.text
--- a/htdocs/manage/circle/edit.bml.text Tue Aug 11 06:14:27 2009 +0000
+++ b/htdocs/manage/circle/edit.bml.text Tue Aug 11 17:49:34 2009 +0000
@@ -90,6 +90,10 @@
.editfriends.username=Username
+.error.adding.header=Problems Encountered
+
+.error.adding.text=User <strong>[[username]]</strong> does not exist.
+
.error.badjournaltype=Cannot modify friends of this journal type.
.error.updating=There was an error updating your friends list:
_______________________________________________
dw-changelog mailing list
[email protected]
http://lists.dwscoalition.org/mailman/listinfo/dw-changelog