Skip to content

Commit

Permalink
Fix parview formatting issues and declaration of $flag variable.
Browse files Browse the repository at this point in the history
  • Loading branch information
mccrodp committed Nov 1, 2014
1 parent 4337696 commit fe4a5ed
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
8 changes: 4 additions & 4 deletions message_private.install
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function message_private_update_7100() {
// Uninstall Flag data and delete flag.
$flag = flag_get_flag('private_message_notify');
// If the flag does not exist then NULL is returned.
if($flag) {
if ($flag) {
// If the flag exist then reset and delete the flag.
flag_reset_flag($flag);
$flag->delete();
Expand Down Expand Up @@ -421,7 +421,7 @@ function message_private_update_7100() {
'type' => 'list_boolean',
);

if(!field_create_field($field_base)) {
if (!field_create_field($field_base)) {
throw new DrupalUpdateException('Could not create "field_private_message_notify" field base.');
}

Expand Down Expand Up @@ -461,9 +461,9 @@ function message_private_update_7100() {
),
);

if(!field_create_instance($field_instance)) {
if (!field_create_instance($field_instance)) {
throw new DrupalUpdateException('Could not create "field_private_message_notify" field instance.');
}

return t('Updates were successful.');
}
}
2 changes: 1 addition & 1 deletion message_private.module
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function message_private_entity_insert($entity, $type) {
if (is_array($users)) {
foreach ($users as $user) {
$notify = field_get_items('user', $user, 'field_private_message_notify');
if(!empty($notify) && is_array($notify)) {
if (!empty($notify) && is_array($notify)) {
// Get the 1st value of the array as there is only 1 possible item.
$notify = array_shift($notify);
}
Expand Down
3 changes: 1 addition & 2 deletions message_private_og/message_private_og.module
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ function message_private_og_message_insert($message) {
$wrapper = entity_metadata_wrapper('message', $message);

$mail = array();
$flag = flag_get_flag('private_message_notify');
$groups = $wrapper->field_message_groups_ref->value();

if (!empty($groups) && is_array($groups)) {
Expand All @@ -312,7 +311,7 @@ function message_private_og_message_insert($message) {
$users = user_load_multiple($uids);
foreach ($users as $user) {
$notify = field_get_items('user', $user, 'field_private_message_notify');
if(!empty($notify) && is_array($notify)) {
if (!empty($notify) && is_array($notify)) {
// Get the 1st value of the array as there is only 1 possible item.
$notify = array_shift($notify);
}
Expand Down

0 comments on commit fe4a5ed

Please sign in to comment.