GetSimple Support Forum

Full Version: menu_data() bug + fix
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Time for another bug report. I came across this oversight now that I'm busy writing my own menu function from scratch that grabs the page data from menu_data() in the form of XML.

I was receiving errors about the pubDate value.

pubDate is not used at all when you use menu_data() to print your menu, which is probably why Chris overlooked it. However, when returning the information in XML format it will want to add pubDate as by the following line (line 244 of theme_functions.php):
Code:
$xml.="<pubdate><![CDATA[".$pubdate."]]></pubdate>";
The problem here is that the variable $pubdate is undefined.

To fix this, go to line 183 which is:
Code:
$pagesArray[$count]['private'] = $data->private;
And add the following line underneath:
Code:
$pagesArray[$count]['pubDate'] = $data->pubDate;
Now the pubDate will be added to the array that is used by menu_data().

Next, but this comes solely own to prefference, you might want to change line 244 as well. I changed it to use the CamelCase'd version pubDate instead of pubdate.
Code:
$xml.="<pubDate><![CDATA[".$pubdate."]]></pubDate>";

GetSimple version 1.71
Thanks Zegnat - I just added this to the version 2.0 code. Great catches you are finding...