6.0.0-git
2019-03-24

[#12262] problem in _getAttribute() of /usr/share/php/Horde/ActiveSync/Message/Base.php
Summary problem in _getAttribute() of /usr/share/php/Horde/ActiveSync/Message/Base.php
Queue Synchronization
Queue Version Git master
Type Bug
State Not A Bug
Priority 1. Low
Owners
Requester skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de
Created 2013-05-17 (2137 days ago)
Due
Updated 2013-05-30 (2124 days ago)
Assigned 2013-05-17 (2137 days ago)
Resolved 2013-05-30 (2124 days ago)
Milestone
Patch No

History
2013-05-30 19:48:00 Michael Rubinsky Comment #4
State ⇒ Not A Bug
Reply to this comment
Going to close as I can't reproduce and lots has changed internally 
since this report. Please reopen if you see this again.
2013-05-24 07:40:52 skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de Comment #3 Reply to this comment
An empty value for $this->_properties[$name] is perfectly valid here 
- the default value for most attributes is false, so empty() will 
return true. Instead, what you want to do is check if the 
array_key_exists() there.
Thanks, I changed to array_key_exists().
Regardless, I would need a backtrace to see where _getAttributes() 
is being called from, as it should only be asking for properties 
that are known to exist in a given EAS version.
My report was not necessarily about that the return value is wrong, 
but to get rid of the PHP error message, and _maybe_ telling the 
developer, that something is wrong here.

I have added var_export(debug_backtrace(), true), let's see if I get 
something.
2013-05-17 14:24:58 Michael Rubinsky Version ⇒ Git master
Queue ⇒ Synchronization
 
2013-05-17 14:24:08 Michael Rubinsky Comment #2
State ⇒ Feedback
Reply to this comment

[Show Quoted Text - 13 lines]
An empty value for $this->_properties[$name] is perfectly valid here - 
the default value for most attributes is false, so empty() will return 
true. Instead, what you want to do is check if the array_key_exists() 
there.

Regardless, I would need a backtrace to see where _getAttributes() is 
being called from, as it should only be asking for properties that are 
known to exist in a given EAS version.
2013-05-17 12:44:54 skhorde (at) smail (dot) inf (dot) fh-bonn-rhein-sieg (dot) de Comment #1
Type ⇒ Bug
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Summary ⇒ problem in _getAttribute() of /usr/share/php/Horde/ActiveSync/Message/Base.php
Queue ⇒ Kronolith
Milestone ⇒
Patch ⇒ No
Reply to this comment
I have problems with GUI - ActiveSync - Lightning,

in the log I have:

[kronolith] PHP ERROR: Undefined index: body [pid 30676 on line 497 of 
"/usr/share/php/Horde/ActiveSync/Message/Base.php"]

I have added a log message there with:

if(empty($this->_properties[$name])) {        // SKA
                Horde::logMessage('SKA: property "'.$name.'" not set', 'WARN');
                return $default;
        }

When I now create a repeated event in the GUI and use ActiveSync to 
get it, I see:

[horde] SKA: property "uid" not set [pid 3433 on line 498 of 
"/usr/share/php/Horde/ActiveSync/Message/Base.php"]

HORDE: [kronolith] SKA: property "location" not set [pid 4958 on line 
498 of "/usr/share/php/Horde/ActiveSync/Message/Base.php"]

HORDE: [kronolith] SKA: property "sensitivity" not set [pid 4958 on 
line 498 of "/usr/share/php/Horde/ActiveSync/Message/Base.php"]

HORDE: [kronolith] SKA: property "reminder" not set [pid 5592 on line 
498 of "/usr/share/php/Horde/ActiveSync/Message/Base.php"]

HORDE: [kronolith] SKA: property "body" not set [pid 5592 on line 498 
of "/usr/share/php/Horde/ActiveSync/Message/Base.php"]

So, at least you should add the test for empty(), in order to get rid 
of the PHP ERROR message

Saved Queries