summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2009-02-08 23:07:56 +0000
committerEvan Prodromou <evan@controlyourself.ca>2009-02-09 12:43:15 -0500
commit28ef2ccf427683837dde29f8b89ea8d5378f287b (patch)
treea45deae51442482a715a4bd7c5e019c48eae0d89
parent20bfa6daed290378231a2a4fd8b7d9fd98fed1ce (diff)
Ticket #1094 Facebook app invites page was failing if no friends had added the app yet
-rw-r--r--actions/facebookinvite.php21
1 files changed, 17 insertions, 4 deletions
diff --git a/actions/facebookinvite.php b/actions/facebookinvite.php
index 3c872f94b..0d1cb8c4c 100644
--- a/actions/facebookinvite.php
+++ b/actions/facebookinvite.php
@@ -92,6 +92,12 @@ class FacebookinviteAction extends FacebookAction
// Get a list of users who are already using the app for exclusion
$exclude_ids = $this->facebook->api_client->friends_getAppUsers();
+ $exclude_ids_csv = null;
+
+ // fbml needs these as a csv string, not an array
+ if ($exclude_ids) {
+ $exclude_ids_csv = implode(',', $exclude_ids);
+ }
$content = sprintf(_('You have been invited to %s'), common_config('site', 'name')) .
htmlentities('<fb:req-choice url="' . $this->app_uri . '" label="Add"/>');
@@ -103,10 +109,17 @@ class FacebookinviteAction extends FacebookAction
'content' => $content));
$this->hidden('invite', 'true');
$actiontext = sprintf(_('Invite your friends to use %s'), common_config('site', 'name'));
- $this->element('fb:multi-friend-selector', array('showborder' => 'false',
- 'actiontext' => $actiontext,
- 'exclude_ids' => implode(',', $exclude_ids),
- 'bypass' => 'cancel'));
+
+ $multi_params = array('showborder' => 'false');
+ $multi_params['actiontext'] = $actiontext;
+
+ if ($exclude_ids_csv) {
+ $multi_params['exclude_ids'] = $exclude_ids_csv;
+ }
+
+ $multi_params['bypass'] = 'cancel';
+
+ $this->element('fb:multi-friend-selector', $multi_params);
$this->elementEnd('fb:request-form');