You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi @unclecheese. I'm trying to do an SS4 upgrade of your module, based on this fork. I'm running into an error in one of your module methods that bamboozles me and thought you might have a clue since you wrote the logic.
It's in the method Calendar->getEventList()
public function getEventList($start, $end, $filter = null, $limit = null, $announcement_filter = null) {
if(Config::inst()->get(Calendar::class, "caching_enabled")) {
return $this->getCachedEventList($start, $end, $filter, $limit);
}
$eventList = new ArrayList();
foreach($this->getAllCalendars() as $calendar) {
if($events = $calendar->getStandardEvents($start, $end, $filter)) {
$eventList->merge($events);
}
The error occurs at $eventList->merge($events). Seemingly on first pass. Which should be simply adding the results of getStandardEvents() to an empty ArrayList. But this is what I get when that merge is attempted on SS4:
[Emergency] Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query: SELECT DISTINCT "CalendarDateTime"."ClassName", "CalendarDateTime"."LastEdited", "CalendarDateTime"."Created", "CalendarDateTime"."StartDate", "CalendarDateTime"."StartTime", "CalendarDateTime"."EndDate", "CalendarDateTime"."EndTime", "CalendarDateTime"."AllDay", "CalendarDateTime"."EventID", "CalendarDateTime"."ID", CASE WHEN "CalendarDateTime"."ClassName" IS NOT NULL THEN "CalendarDateTime"."ClassName" ELSE 'Unclecheese\\EventCalendar\\CalendarDateTime' END AS "RecordClassName" FROM "CalendarDateTime" INNER JOIN "CalendarEvent" ON = "CalendarEvent"."ID" WHERE ("" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) AND (Recursion != 1) AND ( (StartDate = '2020-04-05') OR (StartDate BETWEEN '2019-10-05' AND '2020-04-05') OR (EndDate BETWEEN '2019-10-05' AND '2020-04-05') ) ORDER BY "CalendarDateTime"."StartDate" ASC, "CalendarDateTime"."StartTime" ASC You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= "CalendarEvent"."ID" WHERE ("" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ' at line 4
Looks like something is coming back empty in that WHERE ("" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) clause. But I can for the life of me see where that where clause comes from. I'm assuming it's a result of the merge. I've checked the datatype of getStandardEvents() and it is an DataList, not an ArrayList. I'm not sure if this has something to do with it.
Any hints at all?
The text was updated successfully, but these errors were encountered:
It has two problems here. getEventClass() returns the namespaced classname, which the code then complains about not being a table. So I just hard code this to "CalendarEvent" to get around it for now.
The issue where the above error comes from however is getDateToEventRelation(). Which returns null. Still digging but any help would be appreciated.
Hi @unclecheese. I'm trying to do an SS4 upgrade of your module, based on this fork. I'm running into an error in one of your module methods that bamboozles me and thought you might have a clue since you wrote the logic.
It's in the method Calendar->getEventList()
The error occurs at $eventList->merge($events). Seemingly on first pass. Which should be simply adding the results of getStandardEvents() to an empty ArrayList. But this is what I get when that merge is attempted on SS4:
[Emergency] Uncaught SilverStripe\ORM\Connect\DatabaseException: Couldn't run query: SELECT DISTINCT "CalendarDateTime"."ClassName", "CalendarDateTime"."LastEdited", "CalendarDateTime"."Created", "CalendarDateTime"."StartDate", "CalendarDateTime"."StartTime", "CalendarDateTime"."EndDate", "CalendarDateTime"."EndTime", "CalendarDateTime"."AllDay", "CalendarDateTime"."EventID", "CalendarDateTime"."ID", CASE WHEN "CalendarDateTime"."ClassName" IS NOT NULL THEN "CalendarDateTime"."ClassName" ELSE 'Unclecheese\\EventCalendar\\CalendarDateTime' END AS "RecordClassName" FROM "CalendarDateTime" INNER JOIN "CalendarEvent" ON = "CalendarEvent"."ID" WHERE ("" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) AND (Recursion != 1) AND ( (StartDate = '2020-04-05') OR (StartDate BETWEEN '2019-10-05' AND '2020-04-05') OR (EndDate BETWEEN '2019-10-05' AND '2020-04-05') ) ORDER BY "CalendarDateTime"."StartDate" ASC, "CalendarDateTime"."StartTime" ASC You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= "CalendarEvent"."ID" WHERE ("" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ' at line 4
Looks like something is coming back empty in that WHERE ("" IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)) clause. But I can for the life of me see where that where clause comes from. I'm assuming it's a result of the merge. I've checked the datatype of getStandardEvents() and it is an DataList, not an ArrayList. I'm not sure if this has something to do with it.
Any hints at all?
The text was updated successfully, but these errors were encountered: