Here's the use case:

A site is in private beta. "invites only" are allowed to register. Existing users should be able to send invites to people, so they can register immediately, WITHOUT including the relationship request. It would just be a simple checkbox for each possible relationship: "Send 'Friend' request too?"

That way, they can still tell people how cool the site is, and you should totally register, but you're not necessarily going to create a user relationship with my account.

Make sense?

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Shawn DeArmond’s picture

This patch is better. I didn't need to check for UR-UI, since it's a dependency anyway.

Oops wrong issue. Meant to put this patch on #1430926: When "The following recipient is already a member:", provide link for relationship request

Shawn DeArmond’s picture

Status: Active » Needs review
FileSize
1.78 KB

Okay, here's the patch for this issue. It creates a checkbox that uses form #states to show the radio buttons for relationships (if applicable). If it's unchecked, it's a normal invite without a UR request. If it's checked, it also includes the UR request.

Since UR-Invite currently has a bug, until it gets committed, you'll have to first apply patch #1 on #1345694: UR-Invite doesn't create required relationship before applying this patch.

Status: Needs review » Needs work

The last submitted patch, ur_invite_request-1430920-2.patch, failed testing.

Shawn DeArmond’s picture

Status: Needs work » Needs review

Of course it failed testing, since it needs that other patch first.

Berdir’s picture

#2: ur_invite_request-1430920-2.patch queued for re-testing.

Berdir’s picture

Status: Needs review » Needs work
+++ b/user_relationship_invites/user_relationship_invites.module
@@ -38,8 +38,21 @@ function user_relationship_invites_form_invite_form_alter(&$form, $form_state) {
+    $form['rtid']['#states'] = array(
+      'visible' => array(  // action to take.
+        ':input[name=ur_request]' => array('checked' => TRUE),
+      ),

The comment should be on a separate line and start with an uppercase letter.

Otherwise, happy to commit this, sounds useful.

Shawn DeArmond’s picture

Status: Needs work » Needs review

Patch updated to fix the comment.

Here's what it looks like now:

index bee7c97..d710007 100644
--- a/user_relationship_invites/user_relationship_invites.module
+++ b/user_relationship_invites/user_relationship_invites.module
@@ -38,8 +38,22 @@ function user_relationship_invites_form_invite_form_alter(&$form, $form_state) {
+    $form['rtid']['#weight'] = 0;
+    // Only show rtid if ur_request is checked.
+    $form['rtid']['#states'] = array(
+      'visible' => array(
+        ':input[name=ur_request]' => array('checked' => TRUE),
+      ),
+    );
Shawn DeArmond’s picture

Let's attach the patch this time.

Berdir’s picture

Status: Needs review » Fixed

Commited, thanks for the re-roll.

Status: Fixed » Closed (fixed)

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