Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Blog Module /

Discuss the Blog Module.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Blog Headlines on HomePage with SilverStripe 3.1.x


Go to End
Reply


14 Posts   3249 Views

Avatar
Fairfax71

Community Member, 20 Posts

16 June 2015 at 10:27pm

Hi,

thanks a lot for your help so far — very appreciated. I owe you a beer…

Here is what I got as output:

int(0)
object(DataList)#1142 (11) {
["dataClass":protected]=>
string(9) "BlogEntry"
["dataQuery":protected]=>
object(DataQuery)#1188 (8) {
["dataClass":protected]=>
string(9) "BlogEntry"
["query":protected]=>
object(SQLQuery)#1148 (12) {
["select":protected]=>
array(0) {
}
["from":protected]=>
array(1) {
["SiteTree"]=>
string(10) ""SiteTree""
}
["where":protected]=>
array(0) {
}
["orderby":protected]=>
array(1) {
["Date"]=>
string(4) "DESC"
}
["groupby":protected]=>
array(0) {
}
["having":protected]=>
array(0) {
}
["limit":protected]=>
array(2) {
["start"]=>
int(0)
["limit"]=>
int(5)
}
["distinct":protected]=>
bool(true)
["delete":protected]=>
bool(false)
["connective":protected]=>
string(3) "AND"
["replacementsOld":protected]=>
array(0) {
}
["replacementsNew":protected]=>
array(0) {
}
}
["collidingFields":protected]=>
array(0) {
}
["queriedColumns":"DataQuery":private]=>
NULL
["queryFinalised":"DataQuery":private]=>
bool(false)
["querySubclasses":protected]=>
bool(true)
["filterByClassName":protected]=>
bool(true)
["queryParams":"DataQuery":private]=>
array(2) {
["Versioned.mode"]=>
string(5) "stage"
["Versioned.stage"]=>
string(4) "Live"
}
}
["model":protected]=>
object(DataModel)#2 (1) {
["customDataLists":protected]=>
array(0) {
}
}
["inAlterDataQueryCall":protected]=>
bool(false)
["failover":protected]=>
NULL
["customisedObject":protected]=>
NULL
["objCache":"ViewableData":private]=>
array(0) {
}
["class"]=>
string(8) "DataList"
["extension_instances":protected]=>
array(0) {
}
["beforeExtendCallbacks":protected]=>
array(0) {
}
["afterExtendCallbacks":protected]=>
array(0) {
}
}

Which unfortunately could just as well be Swahili to me. :( Any ideas what might be wrong?

Cheers,

John

Avatar
Pyromanik

Community Member, 419 Posts

16 June 2015 at 11:30pm

Yeah, it's returning no BlogEntry objects. You either have none, or are filtering them all out.
change the die lie to be:
die(var_dump($num));

if it comes back as NULL, or '' or 0 (zero), then that'll probably be the cause of your problem.

Avatar
Fairfax71

Community Member, 20 Posts

16 June 2015 at 11:48pm

Thanks again for your reply. This time I get:

int(5)

as output. I’m still lost (and probably now owe you two beers).

Thanks in advance,

John

Avatar
Fairfax71

Community Member, 20 Posts

17 June 2015 at 12:15am

Just to be clear, the blog in question was upgraded from a much older one (blog 0.4.1 and SS 2.4.2), and there are definitely blog entries in it. You can see the test site here:

http://beta-2015.baf-im-netz.de

and the blog entries are visible here:

http://beta-2015.baf-im-netz.de/aktuelles/

So the blog itself seems to be working fine…

Which brings me to another weird problem I discovered: The old blog entries appear in the editor, but only actually show up on the site once I open them and save them again. Would be nice if I could just have the old entries show up at all without having to re-open each one individually in the editor, but that’s a relatively minor issue at this point.

Cheers,

John

Avatar
Pyromanik

Community Member, 419 Posts

17 June 2015 at 12:51am

Well, you can perhaps do a bulk action (see at the top of the site tree before loading a page to edit). Choose all blog entries and publish them.
This could be related to the reason none show up in your query (if none are published, then there are none to show).

Another thing to try is to not filter, sort or limit the results.
It will return a big list, but at least you'll know it's working. Then apply the other methods one by one to get what you want. If it stops working at some point you'll have a better idea why.

Avatar
TGx`

Community Member, 10 Posts

27 June 2017 at 5:27pm

So you need to debug the problem.

________________________________________________
goldenslot

Go to Top