-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Patch OG module to fix permission conflict issue and add membership p…
…ending request message.
- Loading branch information
Showing
5 changed files
with
104 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
The following patches have been applied to this project: | ||
- https://www.drupal.org/files/issues/2020-07-15/og-ignore-grants-permissions-3159453-2.patch | ||
- og_ui-membership-pending-request-msg.patch | ||
|
||
This file was automatically generated by Drush Make (http://drupal.org/project/drush). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
profiles/pece/modules/contrib/og/og_ui-membership-pending-request-msg.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From c612699560440fda3bc7ea1043266ac84aa1a99e Mon Sep 17 00:00:00 2001 | ||
From: Renato Vasconcellos <revagomes@gmail.com> | ||
Date: Thu, 16 Jul 2020 01:54:43 -0300 | ||
Subject: [PATCH] Add pending message on Group page after subscription action. | ||
|
||
--- | ||
og_ui/og_ui.module | 17 +++++++++++++++++ | ||
1 file changed, 17 insertions(+) | ||
|
||
diff --git a/og_ui/og_ui.module b/og_ui/og_ui.module | ||
index 879480c7..3e3d8b86 100644 | ||
--- a/og_ui/og_ui.module | ||
+++ b/og_ui/og_ui.module | ||
@@ -611,6 +611,23 @@ function og_ui_field_formatter_view($entity_type, $entity, $field, $instance, $l | ||
$links['href'] = "group/$entity_type/$id/unsubscribe"; | ||
$links['class'] = 'group unsubscribe'; | ||
} | ||
+ if (og_is_member($entity_type, $id, 'user', $account, array(OG_STATE_PENDING))) { | ||
+ $element[] = array( | ||
+ '#type' => 'html_tag', | ||
+ '#tag' => 'span', | ||
+ '#attributes' => array('title' => t('Membership Pending'), 'class' => 'group pending-status'), | ||
+ '#value' => t('Membership Pending'), | ||
+ ); | ||
+ | ||
+ return $element; | ||
+ } | ||
+ if (og_is_member($entity_type, $id, 'user', $account, array(OG_STATE_ACTIVE))) { | ||
+ if (og_user_access($entity_type, $id, 'unsubscribe', $account)) { | ||
+ $links['title'] = t('Unsubscribe from group'); | ||
+ $links['href'] = "group/$entity_type/$id/unsubscribe"; | ||
+ $links['class'] = 'group unsubscribe'; | ||
+ } | ||
+ } | ||
} | ||
else { | ||
if (og_is_member($entity_type, $id, 'user', $account, array(OG_STATE_BLOCKED))) { | ||
-- | ||
2.17.1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
profiles/pece/patches/og_ui-membership-pending-request-msg.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
From c612699560440fda3bc7ea1043266ac84aa1a99e Mon Sep 17 00:00:00 2001 | ||
From: Renato Vasconcellos <revagomes@gmail.com> | ||
Date: Thu, 16 Jul 2020 01:54:43 -0300 | ||
Subject: [PATCH] Add pending message on Group page after subscription action. | ||
|
||
--- | ||
og_ui/og_ui.module | 17 +++++++++++++++++ | ||
1 file changed, 17 insertions(+) | ||
|
||
diff --git a/og_ui/og_ui.module b/og_ui/og_ui.module | ||
index 879480c7..3e3d8b86 100644 | ||
--- a/og_ui/og_ui.module | ||
+++ b/og_ui/og_ui.module | ||
@@ -611,6 +611,23 @@ function og_ui_field_formatter_view($entity_type, $entity, $field, $instance, $l | ||
$links['href'] = "group/$entity_type/$id/unsubscribe"; | ||
$links['class'] = 'group unsubscribe'; | ||
} | ||
+ if (og_is_member($entity_type, $id, 'user', $account, array(OG_STATE_PENDING))) { | ||
+ $element[] = array( | ||
+ '#type' => 'html_tag', | ||
+ '#tag' => 'span', | ||
+ '#attributes' => array('title' => t('Membership Pending'), 'class' => 'group pending-status'), | ||
+ '#value' => t('Membership Pending'), | ||
+ ); | ||
+ | ||
+ return $element; | ||
+ } | ||
+ if (og_is_member($entity_type, $id, 'user', $account, array(OG_STATE_ACTIVE))) { | ||
+ if (og_user_access($entity_type, $id, 'unsubscribe', $account)) { | ||
+ $links['title'] = t('Unsubscribe from group'); | ||
+ $links['href'] = "group/$entity_type/$id/unsubscribe"; | ||
+ $links['class'] = 'group unsubscribe'; | ||
+ } | ||
+ } | ||
} | ||
else { | ||
if (og_is_member($entity_type, $id, 'user', $account, array(OG_STATE_BLOCKED))) { | ||
-- | ||
2.17.1 | ||
|