浏览代码

fix error on next events fetching

Olivier Massot 9 月之前
父节点
当前提交
442d386037

+ 0 - 1
ot_core/Classes/Domain/Repository/EventRepository.php

@@ -48,7 +48,6 @@ class EventRepository extends BaseApiRepository
             $params['itemsPerPage'] = $limit;
         }
         if ($fromDate !== null) {
-            // Inutile a priori: la view de l'API s'en occupe déjà en amont
             $params['filter[where][datetimeEnd][gte]'] = $fromDate->format('c');
         }
         if ($toDate !== null) {

+ 3 - 3
ot_templating/Classes/ViewHelpers/Events/GetNextViewHelper.php

@@ -129,12 +129,12 @@ class GetNextViewHelper extends OtAbstractViewHelper {
         try {
             if ($fromChildren) {
                 // Network: Get the next events of the parent structures
-                $events = $this->eventRepository->findChildrenByOrganizationId($organizationId, $fromDate, $toDate, $limit);
+                $events = $this->eventRepository->findChildrenByOrganizationId($organizationId, null, $toDate, $limit);
             } else if ($fromParents) {
                 // Simple structure: Get the next events of the parent structures
-                $events = $this->eventRepository->findParentsByOrganizationId($organizationId, $fromDate, $toDate, $limit);
+                $events = $this->eventRepository->findParentsByOrganizationId($organizationId, null, $toDate, $limit);
             } else {
-                $events = $this->eventRepository->findByOrganizationId($organizationId, $fromDate, $toDate, $limit);
+                $events = $this->eventRepository->findByOrganizationId($organizationId, null, $toDate, $limit);
             }
         } catch (ApiRequestException $e) {
             OtLogger::error(sprintf('API Error: %s', $e->getMessage()));