URGENT upgrade messed up my autonav template
Permalink
this part of my autonav template no longer works since upgrading from 5.3 to 5.4!!! HELP!
if ($ni->getName() == 'calendar' || $ni->getName() == 'news') { $myDB = Loader::db(); $calIDs = $myDB->execute(" SELECT p.cID FROM Pages p JOIN CollectionVersions cv ON p.cID = cv.cID JOIN PageTypes pt ON p.ctID = pt.ctID WHERE pt.ctHandle = 'calendar_event' AND cIsTemplate = 0 AND cvDatePublic >= SYSDATE() AND cvIsApproved = 1 ORDER BY cvDatePublic LIMIT 1 "); $eID = $calIDs->fetchRow(); $eID = $eID[0];
Viewing 15 lines of 18 lines. View entire code block.
are you up to date with concrete 5.4.0.5? We had some autonav issues that that update should have rectified.
up 2 date...
basically, before it would link to the latest (closest to today) calendar event.
basically, before it would link to the latest (closest to today) calendar event.
still haven't been able to resolve this... any clues? hints? solutions?
are you using sql stmts in your template? I recommend not to use such stuff because you're working with an oop system where you have methods to access data, these methods will always work, even with a newer version...
But I don't see why it doesn't work right now. What does it return? Nothing? Wrong data? Try removing some tables and start with CollectionVersion to see if it returns any data, then add Pages, run query again, add types, run it again... You'll quickly see where the problems starts..
But I don't see why it doesn't work right now. What does it return? Nothing? Wrong data? Try removing some tables and start with CollectionVersion to see if it returns any data, then add Pages, run query again, add types, run it again... You'll quickly see where the problems starts..
thanks remo.
yes, this sql is in a template. i'm not very familiar with working with databases. this was recommended by another concrete5 user and was working before.
i removed this:
and now it works... not sure what that did/does.
yes, this sql is in a template. i'm not very familiar with working with databases. this was recommended by another concrete5 user and was working before.
i removed this:
$eID = $eID[0];
and now it works... not sure what that did/does.
I've just pm'd you some code but I see you have it working...
My code got rid of the exact line you posted about above and replaced it with an alternative.
My code got rid of the exact line you posted about above and replaced it with an alternative.