Skip to content

Commit

Permalink
Corrected dependency of message_private_og to og (2.x)
Browse files Browse the repository at this point in the history
Ensured there was a function_exists check in hook_requirements for og_get_all_group_bundle
Removed some unsused variable declarations found by parview script.
  • Loading branch information
mccrodp committed Dec 5, 2014
1 parent ccfeb75 commit bf11d7c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 11 deletions.
4 changes: 2 additions & 2 deletions message_private.install
Original file line number Diff line number Diff line change
Expand Up @@ -372,9 +372,9 @@ function message_private_uninstall() {
// Check if there are message types on the system. Get the message types and
// get the id of the private_message type and remove it and set the indicator
// to state removed.
if ($entity_type = entity_get_info('message_type')) {
if (entity_get_info('message_type')) {
$message_types = entity_load('message_type');
foreach ($message_types as $id => $message_type) {
foreach ($message_types as $message_type) {
if ($message_type->name == 'private_message') {
entity_delete('message_type', $message_type->id);
$removed = TRUE;
Expand Down
2 changes: 1 addition & 1 deletion message_private_og/message_private_og.info
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ description = Private messages with message access based on OG message reference
core = 7.x

dependencies[] = message_private
dependencies[] = og
dependencies[] = og (2.x)

package = Message
18 changes: 10 additions & 8 deletions message_private_og/message_private_og.install
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,16 @@ function message_private_og_requirements($phase) {
$t = get_t();

if ($phase == 'install' || $phase == 'runtime') {
$bundles = og_get_all_group_bundle();
if (!isset($bundles['node'])) {
$requirements['message_private_og_bundle'] = array(
'title' => $t('Message Private OG'),
'description' => $t('You need a bundle that is a group type to send group messages'),
'severity' => REQUIREMENT_WARNING,
'value' => $t('No group bundle'),
);
if(function_exists('og_get_all_group_bundle')) {
$bundles = og_get_all_group_bundle();
if (!isset($bundles['node'])) {
$requirements['message_private_og_bundle'] = array(
'title' => $t('Message Private OG'),
'description' => $t('You need a bundle that is a group type to send group messages'),
'severity' => REQUIREMENT_WARNING,
'value' => $t('No group bundle'),
);
}
}
}

Expand Down

0 comments on commit bf11d7c

Please sign in to comment.