Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
menu_data() bug + fix
#1
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
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#2
Thanks Zegnat - I just added this to the version 2.0 code. Great catches you are finding...
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply




Users browsing this thread: 1 Guest(s)