6.0.0-alpha10
5/14/25

[#14816] foreach() on null throws Horde ERROR
Summary foreach() on null throws Horde ERROR
Queue Horde Base
Queue Version 5.2.17
Type Bug
State Unconfirmed
Priority 1. Low
Owners
Requester birnbacs (at) gmail (dot) com
Created 05/14/2018 (2557 days ago)
Due
Updated 05/14/2018 (2557 days ago)
Assigned
Resolved
Milestone
Patch Yes

History
05/14/2018 11:22:36 AM birnbacs (at) gmail (dot) com Comment #1
State ⇒ Unconfirmed
Priority ⇒ 1. Low
Type ⇒ Bug
Summary ⇒ foreach() on null throws Horde ERROR
Queue ⇒ Horde Base
Milestone ⇒
Patch ⇒ Yes
Reply to this comment
The setMapper() method of Horde_Rdo_Query throws an error if the used 
mapper has no non-lazy relationships.

PHP ERROR: Invalid argument supplied for foreach() [pid 5933 on line 
132 of "/usr/local/share/pear/Horde/Rdo/Query.php"]

Cause is a foreach() loop over the relationships. This is no problem 
as such but untroduces an unecessary ERROR into the logs.

I fixed this for myself by introducing the following statement in line 
130, right before the loop:

if (is_null($mapper->relationships)) {return $this;}


Saved Queries