Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
f4a0e178
Commit
f4a0e178
authored
Nov 08, 2011
by
Richard Mansfield
Committed by
Gerrit Code Review
Nov 08, 2011
Browse files
Merge "Check value of static variable in group_current_group (bug #887002)"
parents
90c14f3a
79cf0eb2
Changes
2
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/group.php
View file @
f4a0e178
...
...
@@ -1647,16 +1647,13 @@ function group_param_userid($userid) {
function
group_current_group
()
{
static
$group
;
// This function sometimes gets called by the smarty function
// during the execution of a GroupNotFound exception. This
// variable prevents a 2nd exception from being thrown. Perhaps
// better achieved with a global in the exception handler?
static
$dying
;
if
(
isset
(
$group
))
{
return
$group
;
}
if
(
defined
(
'GROUP'
)
&&
!
$dying
)
{
if
(
defined
(
'GROUP'
))
{
$group
=
get_record_select
(
'group'
,
'id = ? AND deleted = 0'
,
array
(
GROUP
),
'*, '
.
db_format_tsfield
(
'ctime'
));
if
(
!
$group
)
{
$dying
=
1
;
throw
new
GroupNotFoundException
(
get_string
(
'groupnotfound'
,
'group'
,
GROUP
));
}
}
...
...
htdocs/lib/web.php
View file @
f4a0e178
...
...
@@ -436,11 +436,12 @@ EOF;
}
if
(
defined
(
'GROUP'
))
{
require_once
(
'group.php'
);
$group
=
group_current_group
();
$smarty
->
assign
(
'GROUP'
,
$group
);
if
(
!
defined
(
'NOGROUPMENU'
))
{
$smarty
->
assign
(
'SUBPAGENAV'
,
group_get_menu_tabs
());
$smarty
->
assign
(
'PAGEHEADING'
,
$group
->
name
);
if
(
$group
=
group_current_group
())
{
$smarty
->
assign
(
'GROUP'
,
$group
);
if
(
!
defined
(
'NOGROUPMENU'
))
{
$smarty
->
assign
(
'SUBPAGENAV'
,
group_get_menu_tabs
());
$smarty
->
assign
(
'PAGEHEADING'
,
$group
->
name
);
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment