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
91789f51
Commit
91789f51
authored
Sep 30, 2008
by
Richard Mansfield
Browse files
Display group not found exception instead of 'exception thrown without a stack frame'
parent
3cafe044
Changes
1
Hide whitespace changes
Inline
Side-by-side
htdocs/lib/group.php
View file @
91789f51
...
...
@@ -784,6 +784,9 @@ function group_get_menu_tabs() {
static
$menu
;
$group
=
group_current_group
();
if
(
!
$group
)
{
return
null
;
}
$menu
=
array
(
'info'
=>
array
(
'path'
=>
'groups/info'
,
...
...
@@ -880,9 +883,16 @@ function group_param_userid($userid) {
function
group_current_group
()
{
static
$group
;
if
(
defined
(
'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
(
defined
(
'GROUP'
)
&&
!
$dying
)
{
$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
));
}
}
...
...
@@ -900,6 +910,9 @@ function group_current_group() {
function
group_sideblock
()
{
require_once
(
'group.php'
);
$data
[
'group'
]
=
group_current_group
();
if
(
!
$data
[
'group'
])
{
return
null
;
}
$data
[
'menu'
]
=
group_get_menu_tabs
();
// @todo either: remove this if interactions become group
// artefacts, or: do this in interaction/lib.php if we leave them
...
...
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