Skip to content
This repository has been archived by the owner on Mar 29, 2020. It is now read-only.

cb_newscal & eventnews - No events in calendar shown #15

Open
bechtlepri opened this issue Sep 18, 2017 · 0 comments
Open

cb_newscal & eventnews - No events in calendar shown #15

bechtlepri opened this issue Sep 18, 2017 · 0 comments

Comments

@bechtlepri
Copy link

bechtlepri commented Sep 18, 2017

Hey there,

We are using following setup:

  • PHP 7.1 CGI
  • TYPO3 LTS 7 (7.6.22)
  • EXT:news v6.1.1
  • EXT:eventnews v2.0.1
  • EXT:cb_newscal v2.0.0

Though the extension is deprecated / not supported, it runs (almost) fine.

Problem:

In the calendar, all news-items with "Is Event" = "TRUE" are now shown at all.
If I set them to "Is Event" = "FALSE" after setting an Event-End-Date, the item is shown in the calendar (frontend).**

I searched for an explanation and found the following code in EXT:eventnews:

File: EXT:eventnews/Classes/Hooks/AbstractDemandedRepository.php
Line: 49
protected function updateEventConstraints(...)
{
...

if ($eventRestriction === Demand::EVENT_RESTRICTION_NO_EVENTS) {
$constraints[] = $query->equals('isEvent', 0)
} elseif ($eventRestriction === Demand::EVENT_RESTRICTION_ONLY_EVENTS {
$constraints[] = $query->equals('isEvent', 1)

...
}
...
}

(Side note: Why is it, hat there is only NO_EVENTS and ONLY_EVENTS not both - News-Events-Items & News-Non-Event-Items?)

Fixing my issue via following addition:

File: EXT:cb_newscal/Classes/Controller/NewsController.php
Line: 44
protected function createDemandObject (...) {
...
after:
$demand->setOrder($demand->getDateField() . ' asc');
add:
$demand->setEventRestriction(0);

After these changes, the issue is fixed.
Events are shown as well as non-event-items in the calendar view.

Hope this helps someone having the same problem as we did.
Feel free to inform me if should change something.

I would love to see the extension updated and those problems fixed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant