6.0.0-beta1
8/14/25

[#13277] Undefined index: devId [pid on line 974 of "/usr/share/php/Horde/ActiveSync/State/Sql.php"]
Summary Undefined index: devId [pid on line 974 of "/usr/share/php/Horde/ActiveSync/State/Sql.php"]
Queue Synchronization
Queue Version FRAMEWORK_5_1
Type Bug
State Resolved
Priority 1. Low
Owners mrubinsk (at) horde (dot) org
Requester skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de
Created 06/20/2014 (4073 days ago)
Due
Updated 06/20/2014 (4073 days ago)
Assigned 06/20/2014 (4073 days ago)
Resolved 06/20/2014 (4073 days ago)
Github Issue Link
Github Pull Request
Milestone
Patch No

History
06/20/2014 09:10:42 PM Git Commit Comment #3 Reply to this comment
Changes have been made in Git (FRAMEWORK_5_2):

commit a11189e8d4ba9aa37d94024438ed02a450b15792
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Fri Jun 20 17:04:21 2014 -0400

     Bug: 13277  Fix removing orphaned device entries.

  .../ActiveSync/lib/Horde/ActiveSync/State/Sql.php  |   20 
+++++++++++++-------
  1 files changed, 13 insertions(+), 7 deletions(-)

http://github.com/horde/horde/commit/a11189e8d4ba9aa37d94024438ed02a450b15792
06/20/2014 09:05:47 PM Michael Rubinsky State ⇒ Resolved
 
06/20/2014 09:05:37 PM Git Commit Comment #2 Reply to this comment
Changes have been made in Git (master):

commit 9f66bd80dde2078abbf20a33344aa48aedcd9114
Author: Michael J Rubinsky <mrubinsk@horde.org>
Date:   Fri Jun 20 17:04:21 2014 -0400

     Bug: 13277  Fix removing orphaned device entries.

  .../ActiveSync/lib/Horde/ActiveSync/State/Sql.php  |   20 
+++++++++++++-------
  1 files changed, 13 insertions(+), 7 deletions(-)

http://github.com/horde/horde/commit/9f66bd80dde2078abbf20a33344aa48aedcd9114
06/20/2014 04:43:30 PM Michael Rubinsky Assigned to Michael Rubinsky
State ⇒ Assigned
 
06/20/2014 01:52:33 PM skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de Comment #1
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ Undefined index: devId [pid on line 974 of "/usr/share/php/Horde/ActiveSync/State/Sql.php"]
Queue ⇒ Synchronization
Milestone ⇒
Patch ⇒ No
State ⇒ Unconfirmed
Reply to this comment
These PHP-Errors are generated, if you call

             $GLOBALS['injector']->getInstance('Horde_ActiveSyncState')
                 ->removeState(array('user' => $user));


HORDE: [horde] PHP ERROR: Undefined index: devId [pid 22012 on line 
974 of "/usr/share/php/Horde/ActiveSync/State/Sql.php"]
HORDE: [horde] PHP ERROR: Undefined index: devId [pid 22012 on line 
976 of "/usr/share/php/Horde/ActiveSync/State/Sql.php"]

line 970:
             } elseif (!empty($user_query) && empty($options['devId'])) {
                 // If there was a user_deletion, check if we should remove the
                 // device entry as well
                 $sql = 'SELECT COUNT(*) FROM ' . 
$this->_syncUsersTable . ' WHERE device_id = ?';
                 if (!$this->_db->selectValue($sql, 
array($options['devId']))) {

if $options['devId'] in line 970 is empty, line 974 makes no sense.

If I understand the comment correctly, Shouldn't this piece of code 
remove all devices that had a relation in 
horde_activesync_device_users, but became orphan now?
I mean: device_ids removed from  horde_activesync_device_users, but 
have no other associated user in that table left. -> Orphaned devices 
so to say.

Saved Queries