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

Grayside’s picture

FileSize
3 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.

Grayside’s picture

FileSize
3.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.

amitaibu’s picture

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

Grayside’s picture

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

Grayside’s picture

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?

amitaibu’s picture

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.

Grayside’s picture

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

hefox’s picture

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.

Grayside’s picture

Status:Needs work» Needs review
FileSize
2.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.

Grayside’s picture

Status:Needs review» Needs work
FileSize
8.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.

Grayside’s picture

FileSize
9.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.

Grayside’s picture

Assigned:Grayside» Unassigned
Status:Needs work» Needs review
FileSize
10.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.

Grayside’s picture

FileSize
11.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!

Grayside’s picture

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.

Grayside’s picture

Status:Reviewed & tested by the community» Fixed

Status:Fixed» Closed (fixed)

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