[Tickets #14581] Re: Array operation on non-array throws warnings - fix available

noreply at bugs.horde.org noreply at bugs.horde.org
Wed Feb 22 07:25:26 UTC 2017


BITTE NICHT AUF DIESE NACHRICHT ANTWORTEN. NACHRICHTEN AN DIESE  
E-MAIL-ADRESSE WERDEN NICHT GELESEN.

Ticket-URL: https://bugs.horde.org/ticket/14581
------------------------------------------------------------------------------
  Ticket           | 14581
  Aktualisiert Von | torben at dannhauer.info
  Zusammenfassung  | Array operation on non-array throws warnings - fix
                   | available
  Warteschlange    | Horde Base
  Version          | Git master
  Typ              | Bug
  Status           | Assigned
  Priorität        | 1. Low
  Milestone        |
  Patch            | 1
  Zuständige       | Michael Rubinsky
------------------------------------------------------------------------------


torben at dannhauer.info (2017-02-22 07:25) hat geschrieben:

>>>> Do you have any custom {app}/config/menu.php files?
>>>
>>> Yes for wicked. But currently it does not work, the links are not  
>>> displayed.
>>> I'm on the road, will post the content later.
>>>
>>> Thanks,
>>> Torben
>>>
>>
>> This is my horde/wicked/config/menu.php :
>>
>>
>> <?php
>> /*
>>  * This file lets you extend Wicked's menu with your own items.
>>  *
>>  * To add a new menu item, simply add a new entry to the $_menu array.
>>  * Valid attributes for a new menu item are:
>>  *
>>  *  'url'       The URL value for the menu item.
>>  *  'text'      The text to accompany the menu item.
>>  *
>>  * These attributes are optional:
>>  *
>>  *  'icon'      The filename of an icon to use for the menu item.
>>  *  'icon_path' The path to the icon if it doesn't exist in the graphics/
>>  *              directory.
>>  *  'target'    The "target" of the link (e.g. '_top', '_blank').
>>  *  'onclick'   Any JavaScript to execute on the "onclick" event.
>>  *
>>  * Here's an example entry:
>>  *
>>  *  $_menu[] = array(
>>  *      'url' =>        'http://www.example.com/',
>>  *      'text' =>       'Example, Inc.',
>>  *      'icon' =>       'example.gif',
>>  *      'icon_path' =>  'http://www.example.com/images/',
>>  *      'target' =>     '_blank',
>>  *      'onclick' =>    ''
>>  *  );
>>  *
>>  * You can also add a "separator" (a spacer) between menu items.  To add a
>>  * separator, simply add a new string to the $_menu array set to the text
>>  * 'separator'.  It should look like this:
>>  *
>>  *  $_menu[] = 'separator';
>>  */
>>
>> $_menu = array();
>>
>> /* Add your custom entries below this line. */
>>
>> $_menu[] = 'separator';
>
> Perfect. This is the culprit. This file instructs to add a string,  
> yet the phpdoc of the method that is called to add the menu entry  
> requires a string. I guess it makes the most sense to allow an array  
> or a string containing 'separator' seeing how these instructions are  
> out in the wild...
>
>

Hm, if the seperator string is the culprit, we need either change the  
way seperators are defined, or we allow arrays and strings and need to  
adapt the code down the road to accept it.

What is your recommended solution?

Thanks,
Torben






More information about the bugs mailing list