[Notice] Trying to get property of non-object Link to this post
I have just been approached to tackle an error on a Silverstripe website. The highlighted error is Line 67. Is it perhaps a PHP version error?
---------------------------------
[Notice] Trying to get property of non-object
GET /
Line 67 in /home/brillian/public_html/mysite/code/Page.php
Source
58 // instead of putting Requirements calls here. However these are
59 // included so that our older themes still work
60 Requirements::themedCSS('layout');
61 Requirements::themedCSS('typography');
62 Requirements::themedCSS('form');
63 }
64
65 function LatestNews($number=1) {
66 $holder = DataObject::get_one('BlogHolder', "Title = 'Blog'");
67 return DataObject::get('BlogEntry', "ParentID = {$holder->ID}","Date DESC", false, $number);
68 }
69
70 function LastUpdated() {
71 return DataObject::get('Page', 'ShowInMenus = 1', 'LastEdited DESC', '', 1);
72 }
73
Trace
Page_Controller->LatestNews()
Line 369 of ViewableData.php
ViewableData->obj(LatestNews,,1,,)
Line 823 of ViewableData.php
ViewableData_Customised->obj(LatestNews)
Line 330 of .cache.themes.ruthmorris.templates.Page.ss
include(/home/brillian/public_html/silverstripe-cache/.cache.themes.ruthmorris.templates.Page.ss)
Line 429 of SSViewer.php
SSViewer->process(HomePage_Controller)
Line 202 of Controller.php
Controller->handleAction(SS_HTTPRequest)
Line 143 of RequestHandler.php
RequestHandler->handleRequest(SS_HTTPRequest)
Line 147 of Controller.php
Controller->handleRequest(SS_HTTPRequest)
Line 199 of ContentController.php
ContentController->handleRequest(SS_HTTPRequest)
Line 67 of ModelAsController.php
ModelAsController->handleRequest(SS_HTTPRequest)
Line 111 of RootURLController.php
RootURLController->handleRequest(SS_HTTPRequest)
Line 282 of Director.php
Director::handleRequest(SS_HTTPRequest,Session)
Line 125 of Director.php
Director::direct(/)
Line 127 of main.php