Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
O
og
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
1
Merge Requests
1
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
og
Commits
dddfd864
Commit
dddfd864
authored
Jun 23, 2017
by
Aron Novak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
og_ui: fix non-existing group test
parent
cd2d5182
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
og_ui/og_ui.module
og_ui/og_ui.module
+5
-1
og_ui/og_ui.test
og_ui/og_ui.test
+5
-1
No files found.
og_ui/og_ui.module
View file @
dddfd864
...
...
@@ -1117,13 +1117,17 @@ function og_ui_get_group_admin($entity_type, $etid) {
}
// ensure we are invoking this on something worth doing it on
$entity
=
entity_load_single
(
$entity_type
,
$etid
);
if
(
!
$entity
)
{
// It is a non-existing group Id, giving up.
return
FALSE
;
}
$entity_info
=
entity_get_info
(
$entity_type
);
// if this isn't a group type, skip invoking admin modules
if
(
empty
(
$entity_info
[
'entity keys'
][
'bundle'
])
||
!
og_is_group_type
(
$entity_type
,
$entity
->
{
$entity_info
[
'entity keys'
][
'bundle'
]}))
{
$cache
[
"
$entity_type
:
$etid
"
]
=
FALSE
;
return
FALSE
;
}
$data
=
module_invoke_all
(
'og_ui_get_group_admin'
,
$entity_type
,
$etid
);
...
...
og_ui/og_ui.test
View file @
dddfd864
...
...
@@ -435,8 +435,12 @@ class OgUiManagePeopleTestCase extends DrupalWebTestCase {
$this
->
drupalGet
(
'entity_test/0x'
.
$this
->
entity
->
pid
.
'/group'
);
$this
->
assertResponse
(
403
);
// Non-existing groups return 404 however.
$this
->
drupalGet
(
'entity_test/666
/group
'
);
$this
->
drupalGet
(
'entity_test/666'
);
$this
->
assertResponse
(
404
);
// For the same, admin area returns 403.
$this
->
drupalGet
(
'entity_test/666/group'
);
$this
->
assertResponse
(
403
);
}
}
...
...
Write
Preview
Markdown
is supported
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