GetSimple Support Forum
BUG REPORT menu_data() returns incorrect data - Printable Version

+- GetSimple Support Forum (http://get-simple.info/forums)
+-- Forum: GetSimple (http://get-simple.info/forums/forumdisplay.php?fid=3)
+--- Forum: General Questions and Problems (http://get-simple.info/forums/forumdisplay.php?fid=16)
+--- Thread: BUG REPORT menu_data() returns incorrect data (/showthread.php?tid=7821)



menu_data() returns incorrect data - HelLViS69 - 2016-01-07

Hi all,
this is my first post on this forum and I want to thank you all for this great CMS.


I was creating my own menu on my site and I found that menu_data() adds pages even if they aren't added to menu.
Looking at data returned, I see that there are "menu_*" array keys which are empty. Is this the right behaviour or is it a bug? I mean, if I don't add a page to the menu, it shouldn't be returned from menu_data(). Of course, I can skip those entries, just want to know if this behaviour is a feature or a bug.

Code:
Array
(
   [0] => Array
       (
           [slug] => test
           [url] => http://www.foo.bar/test/
           [parent_slug] =>
           [title] => test
           [menu_priority] => 0
           [menu_text] =>
           [menu_status] =>
           [private] =>
           [pub_date] => Tue, 06 Oct 2015 00:59:59 +0200
       )

   [1] => Array
       (
           [slug] => index
           [url] => http://www.foo.bar/
           [parent_slug] =>
           [title] => Home
           [menu_priority] => 1
           [menu_text] => Home
           [menu_status] => Y
           [private] =>
           [pub_date] => Tue, 06 Oct 2015 00:59:18 +0200
       )



RE: menu_data() returns incorrect data - shawn_a - 2016-01-08

you have to filter it on your own