6.0.0-beta1
▾
Tasks
New Task
Search
Photos
Wiki
▾
Tickets
New Ticket
Search
dev.horde.org
Toggle Alerts Log
Help
7/28/25
H
istory
A
ttachments
C
omment
W
atch
Download
Comment on [#14581] Array operation on non-array throws warnings - fix available
*
Your Email Address
*
Spam protection
Enter the letters below:
. .. ..__ . .. |__|| |[__)|__|| | ||/\|[__)| ||___
Comment
> The function addArray($item) in > /home/torben/horde/framework/Core/lib/Horde/Menu.php : line 71 > > performs array operations on (potential non-arrays). This throws > warnings caused in multiple lines of the functions and pollutes the > error log. > > The suggest solution is to convert $item to an array before working > with array operations on it. > > The function should be like this: > ----- > > /** > * Add an item to the menu array. > * > * @param array $item The item to add. Valid keys: > * <pre> > * 'class' - (string) CSS classname. > * 'icon' - (string) Filename of the image icon. > * 'icon_path' - (string) Non-default directory path for icon. > * 'onclick' - (string) Onclick javascript. > * 'target' - (string) HREF target parameter. > * 'text' - (string) Label. > * 'url' - (string) Hyperlink. > * </pre> > * > * @return integer The id (NOT guaranteed to be an array index) of the > * item just added to the menu. > */ > public function addArray($item) > { > $item = array($item); > if (!isset($item['url'])) { > $item['url'] = new Horde_Url(); > } elseif (!($item['url'] instanceof Horde_Url)) { > $item['url'] = new Horde_Url($item['url']); > } > > $this->_menu[] = array_merge(array( > 'class' => null, > 'icon' => '', > 'icon_path' => null, > 'onclick' => null, > 'target' => '', > 'text' => '' > ), $item); > } > > >
Attachment
Watch this ticket
N
ew Ticket
M
y Tickets
S
earch
Q
uery Builder
R
eports
Saved Queries
Open Bugs
Bugs waiting for Feedback
Open Bugs in Releases
Open Enhancements
Enhancements waiting for Feedback
Bugs with Patches
Enhancements with Patches
Release Showstoppers
Stalled Tickets
New Tickets
Horde 5 Showstoppers