I have a LatestNews function which shows the latest news on my startpage. That worked really well (since it's from the tutorial), but doesn't anymore. I looked in the database for my NewsHolder and it's there as it should. Does anyone have this error too?
ok that function is not behaving as you expect, but I am telling you dataobject::get_one works and my guess is the function will work for you but there is likely something with your data that may have changed... for example recently when upgrading a site the ClassNames were randomly blanked in the site tree... see here... http://silverstripe.org/all-other-modules/show/285615#post285615... I'd guess it was that as your function also relies on dataobject::get page and the page data might be mangled...
have you verified all of your data and debugged (e.g. put Debug::show() all over the place) the data flowing through the function?
Well, the interesting thing is, that there is no table called "NewsHolder". There are tables for "NewsPage" (the children). Because of that, I thought that would be the problem, installed a clean version of 2.4.2 and added the code from the tutorial. In that new database of the test-version, there is also no table "ArticleHolder" ("NewsHolder") but the function works. Damn.
Within Sitetree and Sitetree_Live the IDs are okay.