diff --git a/lib/WebGUI/Group.pm b/lib/WebGUI/Group.pm index a73984f19..3502e6875 100755 --- a/lib/WebGUI/Group.pm +++ b/lib/WebGUI/Group.pm @@ -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. diff --git a/lib/WebGUI/Macro/GroupAdd.pm b/lib/WebGUI/Macro/GroupAdd.pm index 6cd1897d7..1be988f92 100644 --- a/lib/WebGUI/Macro/GroupAdd.pm +++ b/lib/WebGUI/Macro/GroupAdd.pm @@ -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 = (); diff --git a/lib/WebGUI/Session/Env.pm b/lib/WebGUI/Session/Env.pm index 0fb4efbf9..396f6c48d 100644 --- a/lib/WebGUI/Session/Env.pm +++ b/lib/WebGUI/Session/Env.pm @@ -91,7 +91,7 @@ sub getIp { =head2 new ( ) -Constructor. Returns a stow object. +Constructor. Returns an env object. =cut