Download & Extend

Better UI for Moderated Group Pending Membership

Project:Organic groups
Version:6.x-2.x-dev
Component:og.module
Category:feature request
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

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".

AttachmentSizeStatusTest resultOperations
og.awaiting.patch3.04 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og.awaiting.patch. This may be a -p0 (old style) patch, which is no longer supported by the testbots.View details

Comments

#1

Same 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.

AttachmentSizeStatusTest resultOperations
og.awaiting-1.patch3 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og.awaiting-1.patch. Unable to apply patch. See the log in the details link for more information.View details

#2

That last one was a bit screwy. This replaces #1, and is competing with #0.

AttachmentSizeStatusTest resultOperations
og.awaiting-2.patch3.01 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og.awaiting-2.patch. Unable to apply patch. See the log in the details link for more information.View details

#3

@Grayside,
Thanks, can you add a simpletest to check the new API function?

#4

@Amitaibu
I will try to get to writing a test this week.

#5

I'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?

#6

og_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.

#7

So 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.

AttachmentSizeStatusTest resultOperations
og.1055508-test.patch7.09 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og.1055508-test.patch. Unable to apply patch. See the log in the details link for more information.View details

#8

Status:needs review» needs work

Grayside will be updating the patch to not re-use $gid inside og_is_pending_member causing it to return incorrectly first call sometimes.

#9

Status:needs work» needs review

Reroll and tweak of #2.

AttachmentSizeStatusTest resultOperations
og.1055508-9.patch2.66 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og.1055508-9.patch. Unable to apply patch. See the log in the details link for more information.View details

#10

Status:needs review» needs work

Combined patch, incremented forward some. Test is failing in an incomplete state, but no more time tonight for debug.

AttachmentSizeStatusTest resultOperations
og.1055508-10_request_ui.patch8.57 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og.1055508-10_request_ui.patch. Unable to apply patch. See the log in the details link for more information.View details

#11

Another 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.

AttachmentSizeStatusTest resultOperations
og.1055508-11_request_ui.patch9.71 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og.1055508-11_request_ui.patch. Unable to apply patch. See the log in the details link for more information.View details

#12

Assigned to:Grayside» Anonymous
Status:needs work» needs review

Got it.

AttachmentSizeStatusTest resultOperations
og.1055508-12_request_ui.patch10.3 KBIdleFAILED: [[SimpleTest]]: [MySQL] Unable to apply patch og.1055508-12_request_ui.patch. Unable to apply patch. See the log in the details link for more information.View details

#13

Testbot 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!

AttachmentSizeStatusTest resultOperations
og.1055508-13_request_ui.patch11.53 KBIdlePASSED: [[SimpleTest]]: [MySQL] 269 pass(es).View details

#14

Status:needs review» reviewed & tested by the community

Testbot approved. Setting to RTBC to create a shortlist of things I think are ready to commit with a quick second nomination.

#15

Status:reviewed & tested by the community» fixed

http://drupalcode.org/project/og.git/commit/8a47a65

#16

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.