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

Files: 
CommentFileSizeAuthor
#13 og.1055508-13_request_ui.patch11.53 KBGrayside
PASSED: [[SimpleTest]]: [MySQL] 269 pass(es).
[ View ]
#12 og.1055508-12_request_ui.patch10.3 KBGrayside
FAILED: [[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 ]
#10 og.1055508-10_request_ui.patch8.57 KBGrayside
FAILED: [[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 ]
#9 og.1055508-9.patch2.66 KBGrayside
FAILED: [[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 ]
#7 og.1055508-test.patch7.09 KBGrayside
FAILED: [[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 ]
#2 og.awaiting-2.patch3.01 KBGrayside
FAILED: [[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 ]
#1 og.awaiting-1.patch3 KBGrayside
FAILED: [[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 ]
og.awaiting.patch3.04 KBGrayside
FAILED: [[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 ]

Comments

StatusFileSize
new3 KB
FAILED: [[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 ]

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.

StatusFileSize
new3.01 KB
FAILED: [[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 ]

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

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

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

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?

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.

StatusFileSize
new7.09 KB
FAILED: [[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 ]

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.

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.

Status:Needs work» Needs review
StatusFileSize
new2.66 KB
FAILED: [[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 ]

Reroll and tweak of #2.

Status:Needs review» Needs work
StatusFileSize
new8.57 KB
FAILED: [[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 ]

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

StatusFileSize
new9.71 KB
FAILED: [[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 ]

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.

Assigned:Grayside» Unassigned
Status:Needs work» Needs review
StatusFileSize
new10.3 KB
FAILED: [[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 ]

Got it.

StatusFileSize
new11.53 KB
PASSED: [[SimpleTest]]: [MySQL] 269 pass(es).
[ View ]

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!

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.

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

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