Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Attached patch changes og_subscribe_link() to return a string "Awaiting approval" for users that have already requested membership to the given group. It also changes the subscription form submit button to "Request membership" for moderated groups, instead of simply "Join".
Comment | File | Size | Author |
---|---|---|---|
#13 | og.1055508-13_request_ui.patch | 11.53 KB | Grayside |
#12 | og.1055508-12_request_ui.patch | 10.3 KB | Grayside |
#10 | og.1055508-10_request_ui.patch | 8.57 KB | Grayside |
#9 | og.1055508-9.patch | 2.66 KB | Grayside |
#7 | og.1055508-test.patch | 7.09 KB | Grayside |
Comments
Comment #1
Grayside CreditAttribution: Grayside commentedSame basic approach, but this one relies on og_get_subscriptions() to actually control the database interaction. The goal with this approach is to domino the $reset as thoroughly as possible. Downside: slightly more intensive the first time you run og_is_group_member.
Comment #2
Grayside CreditAttribution: Grayside commentedThat last one was a bit screwy. This replaces #1, and is competing with #0.
Comment #3
amitaibu@Grayside,
Thanks, can you add a simpletest to check the new API function?
Comment #4
Grayside CreditAttribution: Grayside commented@Amitaibu
I will try to get to writing a test this week.
Comment #5
Grayside CreditAttribution: Grayside commentedI've tweaked the og.subscribe.test on account of some of the changes, but I am trying to determine the best way to test og_is_pending_member(). It strikes me that testing og_subscribe_link() thoroughly would include testing that. Not sure what the best approach would be to get og_subscribe_link rendered on the screen. Any suggestions?
Comment #6
amitaibuog_is_pending_member() is an API function, so the test doesn't need to run through the UI. It would be nice, though, to also have a test to the UI part.
Comment #7
Grayside CreditAttribution: Grayside commentedSo not a SimpleTest? Or am I confused? Not really sure how to even test the UI, unless I turn on the PHP module and create a node special for it.
Attached patch modifies an existing test to play nice with the changes. It does not properly address og_is_pending_member(), but I wanted to get the modification into the issue.
Comment #8
hefox CreditAttribution: hefox commentedGrayside will be updating the patch to not re-use $gid inside og_is_pending_member causing it to return incorrectly first call sometimes.
Comment #9
Grayside CreditAttribution: Grayside commentedReroll and tweak of #2.
Comment #10
Grayside CreditAttribution: Grayside commentedCombined patch, incremented forward some. Test is failing in an incomplete state, but no more time tonight for debug.
Comment #11
Grayside CreditAttribution: Grayside commentedAnother increment forward on tests. Somewhat better code reuse, better encapsulation of group membership assertion, but still erroring out, now with a mysterious DB error followed by a no-argument warning.
Comment #12
Grayside CreditAttribution: Grayside commentedGot it.
Comment #13
Grayside CreditAttribution: Grayside commentedTestbot seems jammed, but testing well on my local.
New patch adds a test for og_is_pending_member(), and wonder of wonders, fixes a bug with that function!
Comment #14
Grayside CreditAttribution: Grayside commentedTestbot approved. Setting to RTBC to create a shortlist of things I think are ready to commit with a quick second nomination.
Comment #15
Grayside CreditAttribution: Grayside commentedhttp://drupalcode.org/project/og.git/commit/8a47a65