Skip to content

Commit

Permalink
make sure we're passing update_enabled_child_accounts an array
Browse files Browse the repository at this point in the history
  • Loading branch information
jondavidjohn committed Sep 12, 2012
1 parent 7cc96f9 commit 493c4b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion lib/social/service/facebook.php
Expand Up @@ -603,7 +603,10 @@ public static function social_settings_save($controller) {
foreach ($service->accounts() as $account) {
$updated_accounts = array();
foreach ($service->accounts() as $account) {
$account->update_enabled_child_accounts($enabled_child_ids[$service->key()]);
//default service to empty array in case it is not set
$enabled_child_accounts[$service_key] = isset($enabled_child_accounts[$service_key]) ? $enabled_child_accounts[$service_key] : array();

$account->update_enabled_child_accounts($enabled_child_accounts[$service_key]);
$updated_accounts[$account->id()] = $account->as_object();
}
$service->accounts($updated_accounts)->save($is_profile);
Expand Down
5 changes: 4 additions & 1 deletion social.php
Expand Up @@ -741,7 +741,10 @@ public function personal_options_update($user_id) {
foreach ($this->services() as $service_key => $service) {
$updated_accounts = array();
foreach ($service->accounts() as $account) {
$account->update_enabled_child_accounts($enabled_account_ids[$service_key]);
//default service to empty array in case it is not set
$enabled_child_accounts[$service_key] = isset($enabled_child_accounts[$service_key]) ? $enabled_child_accounts[$service_key] : array();

$account->update_enabled_child_accounts($enabled_child_accounts[$service_key]);
$updated_accounts[$account->id()] = $account->as_object();
}
$service->accounts($updated_accounts)->save($is_profile);
Expand Down

0 comments on commit 493c4b6

Please sign in to comment.