Activate useScrictLang in DayRepository->getDaysForListType, getSubQueryBuilder
After the update to v8 of Events2 the translated page (EN) shows the events from the default language (DE) if no translated events are currently available. I would like to show a message like "No events found" instead. This can be done if the param $useScrictLang is set to true in DayRepository->getDaysForListType $subQueryBuilder = $this->getSubQueryBuilder($queryBuilder, true); in line 91. Can you add a condition to set this param?
Hello @derBoogie
seems that doOverlay here is TRUE which leads to the wrong results:
https://github.com/jweiland-net/events2/blob/main/Classes/Helper/OverlayHelper.php#L136
doOverlay should be FALSE, if you have configured strict mode. So, for now, there seems to be a miss-configuration in your system.
PS: I prefer to use one of these EventListeners in DayRepository to adapt all these Queries to your needs
PS: All these Queries will be re-factored again within the next big release.
Stefan
Hi @sfroemkenjw,
I updated Events2 up to version 9.1.7 with TYPO3 version 12.4.25.
The problem is still there. To take scrict mode into account, I have to add "true" as second param in DayRepository->getDaysForListType $subQueryBuilder = $this->getSubQueryBuilder($queryBuilder, true); in line 93.
TJ
@derBoogie
This is not so easy. TYPO3 internally also "strict" is a kind of overlay. In LanguageAspect it is called includeFloating. It's a combination of hideNonTranslated and records, that are only available in expected language.
My problem is: I don't want to show a list of events, I want to show a list of day records which have a 1:1 relation to event table. So, first query is based on day table. But day table is not translatable. It does not have any overlay. It also does not have any workspace functionallity. All these information can only be found in related event table.
When I send my QueryBuilder with list of day records to extbase QueryParser it will start translating the day records. But, as there is not translation available, the overlay process of TYPO3 can not be taken into account. That's why non translated records are still available in strict mode.
Today I have tried to select event records first, but here the PersistenceSession makes problems. Same event models with same UID but different date are handled as same event and not as two different event model. So, the resulting dates in FE are all the same for one event.
Maybe I can throw away all extbase stuff and query just the expected event records for a specific date range. Then apply overlays and then calculating the day records again. That may work, but cost some more queries.
I already have asked TYPO3 Core guys, but CTE is available since TYPO3 13 first. So, overlay would be done directly in query, without PHP based overlay system (TYPO3 API). I have no clue about CTE at all. Don't know if I have time to solve it that way in events2 for TYPO3 13.
Stefan
I have just tested a further possibility. Get all day records and remove all records where related event record is non-translated. Problem: Paginator is not working anymore. I will stop here. A solution is so hard to implement and will break nearly everything. All EventListeners would not be compatible anymore.
Maybe I will find a solution while upgrading to TYPO3 13.
Stefan
Hi @sfroemkenjw,
because a short-term solution is needed to the problem, I implemented a workaround in the Fluid-Partial Event/List.html: On the EN page (default is DE) all events are mixed in the output (German and English). Using the sys_language_uid, I filter out only the translated ones in EN. This works for the time being, but is not a permanent solution.
TJ