Fixed a typo in the POD for Session/Env.pm

Added more docs for find method in Group.pm
Fixed a latent bug that would probably never occur in Macro/GroupAdd.pm
If Group->find is called with the name of a group that doesn't exist,
then Group will return an object with defaults, and the guid of the
group is undef, not ''.  However, since by default autoAdd is off,
the Macro will still do the right thing.
GroupDelete has the same bug, but it shouldn't be patched until there's
a test written for it.
This commit is contained in:
Colin Kuskie 2006-07-24 05:08:17 +00:00
parent 0be1193574
commit 5dbd9b44c9
3 changed files with 5 additions and 2 deletions

View file

@ -457,6 +457,9 @@ An alternative to the constructor "new", use find as a constructor by name rathe
Returns the first group with that name found. There is no guaranteed order of the search
to be sure not to create groups with the same name!
If the name of the group cannot be found, a new group will not be created. This is
due to how the constructor new handles the null id.
=head3 session
A reference to the current session.

View file

@ -49,7 +49,7 @@ sub process {
return "" if ($param[1] eq "");
return "" if ($session->user->userId eq '1');
my $g = WebGUI::Group->find($param[0]);
return "" if ($g->getId eq "");
return "" unless defined $g->getId;
return "" unless ($g->autoAdd);
return "" if ($session->user->isInGroup($g->getId));
my %var = ();

View file

@ -91,7 +91,7 @@ sub getIp {
=head2 new ( )
Constructor. Returns a stow object.
Constructor. Returns an env object.
=cut