Summary | horde/nag/lib/Nag.php : 1733 [getSyncLists()]: Wron serialized array in prefs triggers warning |
Queue | Nag |
Queue Version | Git master |
Type | Bug |
State | Resolved |
Priority | 1. Low |
Owners | mrubinsk (at) horde (dot) org |
Requester | torben (at) dannhauer (dot) info |
Created | 02/21/2017 (3068 days ago) |
Due | |
Updated | 10/20/2017 (2827 days ago) |
Assigned | 02/27/2017 (3062 days ago) |
Resolved | 03/01/2017 (3060 days ago) |
Github Issue Link | |
Github Pull Request | |
Milestone | |
Patch | Yes |
commit cc51f97fc58140ffd7a7f0b696ec95c3875dea39
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed, 01 Mar 2017 15:19:53 -0500
Bug: 14585Fix saving sync prefs when no default resource exists.M config/prefs.php
https://github.com/horde/turba/commit/cc51f97fc58140ffd7a7f0b696ec95c3875dea39
commit 48a9ecb0fecaed0f3be11c5157cb7d7d3feb7c27
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed, 01 Mar 2017 15:19:53 -0500
Bug: 14585Fix saving sync prefs when no default resource exists.M config/prefs.php
https://github.com/horde/kronolith/commit/48a9ecb0fecaed0f3be11c5157cb7d7d3feb7c27
commit bf909a78d0da39dcc3859479bc92f7b8756713f6
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed, 01 Mar 2017 15:19:53 -0500
Bug: 14585Fix saving sync prefs when no default resource exists.M config/prefs.php
https://github.com/horde/mnemo/commit/bf909a78d0da39dcc3859479bc92f7b8756713f6
commit 11a04dceb73e12aeca15f959ae4786ee67bf3128
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed, 01 Mar 2017 15:19:53 -0500
Bug: 14585Fix saving sync prefs when no default resource exists.M config/prefs.php
https://github.com/horde/nag/commit/11a04dceb73e12aeca15f959ae4786ee67bf3128
commit e812f6fb6b0f128e6e32d1897ac1c340c19f912f
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Fri, 24 Feb 2017 12:40:22 -0500
[mjr] Avoid PHP warnings due to corrupt preference values (
Bug #14585).M docs/CHANGES
M lib/Nag.php
M package.xml
https://github.com/horde/nag/commit/e812f6fb6b0f128e6e32d1897ac1c340c19f912f
Thanks for your service, outstanding as always :)
Torben
commit 1b4cf11b0d53d62c5202d3f85f7cb2555e8fff33
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed Mar 1 15:13:54 2017 -0500
Bug: 14585Fix saving sync prefs when no default resource exists.kronolith/config/prefs.php | 8 ++++++--
mnemo/config/prefs.php | 8 ++++++--
nag/config/prefs.php | 8 ++++++--
turba/config/prefs.php | 6 +++++-
4 files changed, 23 insertions(+), 7 deletions(-)
http://github.com/horde/horde/commit/1b4cf11b0d53d62c5202d3f85f7cb2555e8fff33
commit 97a6ba40fa7659dc71d61a432ea16dacc8a12e51
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Wed Mar 1 15:13:54 2017 -0500
Bug: 14585Fix saving sync prefs when no default resource exists.kronolith/config/prefs.php | 8 ++++++--
mnemo/config/prefs.php | 8 ++++++--
nag/config/prefs.php | 8 ++++++--
turba/config/prefs.php | 6 +++++-
4 files changed, 23 insertions(+), 7 deletions(-)
http://github.com/horde/horde/commit/97a6ba40fa7659dc71d61a432ea16dacc8a12e51
State ⇒ Assigned
first place.
Nag::initialize(), which calls
Nag_Tasklists_Base::ensureDefaultShare().
the horde administration interface. Now the default shares are created
as you describe. Thanks!
Back to the topic of this ticket:
Can you verify my bugreport by the following steps?
1. In the horde configuration, set $conf['share']['auto_create'] = false;
2. delete _all_ tasklists including the default one
3. To to Nag user preferences -> synchronisation settings -> check
"support separate tasklists" and save the pref.
4. Go Into the SQL Database and query: Select * FROM horde_prefs WHERE
pref_value = 'a:1:{i:0;N;}';
I think, that horde should be able to handle non-existent shares in an
app correctly, since Hordes "auto-create" feature is an option and not
mandatory.
Therfore a fix should be applied not only to nag and mnemo (already
done) but also to kronolith and turba.
Now we know what causes the issue, we can either fix it as you did on
the evaluation side of this horde pref ( getSyncXYZ() ), or we fix it
at the creation side in the sync preferences where this value is
stored into the preferences. The latter whould by better regarding
performance...
What do you think?
Nag::initialize(), which calls Nag_Tasklists_Base::ensureDefaultShare().
default tasklist.
I think we should investigate why your setup provides a default
tasklist where mine does not.
Do I need to configure something in horde to create default tasklists?
Where is it created? When the user logs in the first time, or when the
user is added to horde in the admin interface?
In our setup we use $conf['auth']['driver'] = 'sql'; and point to a
different SQL table outside the horde DB. Additionally users are not
added in Horde but from a 3rdParty interface into that auth
database/table. This interface does more than adding the user, so I
don't want to abandon it until I have moved everything into a horde
module.
- I see a "Michael's Tasklist" already choosen. Without
other tasklists is empty, as it should be since there are no
tasklists other than the default - I check "support separate
tasklists" and save the pref. I check the preference value in the
backend, and it appears as it should:
a:1:{i:0;s:23:"xEkS5vys4L4MXV03oZZAiQ4";}
their default calender|tasklist|notepad. Login into a pristine
account had non of them defined.
logged in with a user for the first time. I navigate to the
application's (in this case, nag) preferences and view "Default
Tasklist" - I see a "Michael's Tasklist" already choosen. Without
saving, I navigate to Synchronization preferences - the list of other
tasklists is empty, as it should be since there are no tasklists other
than the default - I check "support separate tasklists" and save the
pref. I check the preference value in the backend, and it appears as
it should:
a:1:{i:0;s:23:"xEkS5vys4L4MXV03oZZAiQ4";}
I'll have to look into this.
Thanks for the research.
their default calender|tasklist|notepad. Login into a pristine account
had non of them defined.
State ⇒ Assigned
have to look into this.
Thanks for the research.
but this prevents the warnings.
The reason is simple:
If you go into the sync settings and enable "separate
notepad|tasks|whatever" without having a single list|notepad|whatever
defined, it creates the faulty 'a:1:{i:0;N;}' entry.
The entry does not disappear if disableing separate
list|notepad|whatever, the the issue seems to be saving the sync pref
page whithout any defined list|notepad|whatever.
but this prevents the warnings.
I had the issue with one of 35 Account - and only nag and Mnemo.
Opening the sync settings (in both, nag and Mnemo) and simply pressing
"save" fixed the faulty entry in the database. Is it possible this is
caused if someone configures multiple collections, configure them as
"sync them additionally to the default one) and then delete them?
-> I tried this and I was proven wrong :) However, I can see, that
deleting an conllection dopes not clean up the pref value.
Example:
I added in Mnemo two collections, configured them both as "to be
synced". The Database contains them both in the pref "sync_notepads".
Deleting one of them does not remove it from the sync_notepads pref value.
I assume that is also valid for nag, turba, kronolith..
Torben
State ⇒ Resolved
Assigned to Michael Rubinsky
this prevents the warnings.
commit da87bbd4b4be301c2633ee75290d4f1f0d17b61e
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Fri Feb 24 12:40:22 2017 -0500
[mjr] Avoid PHP warnings due to corrupt preference values (
Bug #14585).nag/docs/CHANGES | 5 +++++
nag/lib/Nag.php | 4 ++++
nag/package.xml | 2 +-
3 files changed, 10 insertions(+), 1 deletion(-)
http://github.com/horde/horde/commit/da87bbd4b4be301c2633ee75290d4f1f0d17b61e
commit 1dde87a714bab1751b6f8e566f898007439eb1ae
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date: Fri Feb 24 12:40:22 2017 -0500
[mjr] Avoid PHP warnings due to corrupt preference values (
Bug #14585).nag/docs/CHANGES | 1 +
nag/lib/Nag.php | 4 ++++
nag/package.xml | 4 ++--
3 files changed, 7 insertions(+), 2 deletions(-)
http://github.com/horde/horde/commit/1dde87a714bab1751b6f8e566f898007439eb1ae
Priority ⇒ 1. Low
State ⇒ Unconfirmed
Patch ⇒ Yes
Milestone ⇒
Queue ⇒ Nag
Summary ⇒ horde/nag/lib/Nag.php : 1733 [getSyncLists()]: Wron serialized array in prefs triggers warning
Type ⇒ Bug
an PHP warning: 'array_flip(): Can only flip STRING and INTEGER values!'
This is caused by an erroneous Horde Pref like 'a:1:{i:0;N;}'.
Deserialized, this array contains a Null Value and is this not
flippable.
When loaded from the DB and deserialized, the array should be validated with
$cs = array_filter($cs); before it is used.
This is similar to
https://github.com/horde/horde/commit/3fdf04396ec905d53e762cfbac92f070f2487fda
for Mnemo