Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate useScrictLang in DayRepository->getDaysForListType, getSubQueryBuilder #428

Open
derBoogie opened this issue Jul 10, 2023 · 4 comments
Assignees
Labels

Comments

@derBoogie
Copy link

derBoogie commented Jul 10, 2023

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?

@sfroemkenjw
Copy link
Contributor

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

@derBoogie
Copy link
Author

derBoogie commented Jan 20, 2025

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

@sfroemkenjw
Copy link
Contributor

@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

@sfroemkenjw
Copy link
Contributor

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

@sfroemkenjw sfroemkenjw self-assigned this Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants