URGENT upgrade messed up my autonav template
Permalinkif ($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];

basically, before it would link to the latest (closest to today) calendar event.
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..
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.
My code got rid of the exact line you posted about above and replaced it with an alternative.