Skip to content
Permalink
Browse files

Bug: 14585 Fix saving sync prefs when no default resource exists.

  • Loading branch information...
mrubinsk committed Mar 1, 2017
1 parent b99ff32 commit 11a04dceb73e12aeca15f959ae4786ee67bf3128
Showing with 6 additions and 2 deletions.
  1. +6 −2 config/prefs.php
@@ -278,7 +278,11 @@
$enum = array();
$sync = @unserialize($GLOBALS['prefs']->getValue('sync_lists'));
if (empty($sync)) {
$GLOBALS['prefs']->setValue('sync_lists', serialize(array(Nag::getDefaultTasklist(Horde_Perms::DELETE))));
$default_tasklist = Nag::getDefaultTasklist(Horde_Perms::DELETE);
$sync_list = !empty($default_tasklist)
? array($default_tasklist)
: array();
$GLOBALS['prefs']->setValue('sync_lists', serialize($sync_list));
}
foreach (Nag::listTasklists(false, Horde_Perms::DELETE, false) as $key => $list) {
if ($list->getName() != Nag::getDefaultTasklist(Horde_Perms::DELETE)) {
@@ -297,7 +301,7 @@
break;
}
}
if (!$haveDefault) {
if (!$haveDefault && !empty($default)) {
$sync[] = $default;
$GLOBALS['prefs']->setValue('sync_lists', serialize($sync));
}

0 comments on commit 11a04dc

Please sign in to comment.
You can’t perform that action at this time.