Hi,
The calender doesn't show any events when I change my paginaton from "All items" to "Calendar by Month".
I'm using Drupal 9.5.4 en PHP 8.1.1
| Comment | File | Size | Author |
|---|---|---|---|
| #30 | Screenshot from 2023-04-23 12-34-09.png | 97.06 KB | matthieuscarset |
| #18 | Screenshot 2023-03-31 093739.png | 53.27 KB | kenrbnsn |
| #3 | Screenshot 2023-03-24 at 18.22.32.png | 174.24 KB | timme77 |
Comments
Comment #2
matthieuscarset commentedThank you for reporting this issue and please forgive the inconvenience.
Can you please provide more information about your View?
I cannot reproduce the issue on D10 nor D9.
Comment #3
timme77 commentedThe view is filtered on the content type "programma" but also has a relationship with a paragraph. The date field of the paragraph is used for the calendar.
Comment #4
matthieuscarset commentedOh okay.. Thank you for the details.
I can reproduce the bug indeed when using a relationship (e.g. a date field from a paragragraph).
The issue is caused by the new query filtering which apparently does not work correctly on relationship 🤔
I unfortunately don't have a fix for now so I will provide an option to enable/disable the query as a workaround for now
Marking this issue as active and critical as it breaks previously working functionality.
Comment #6
daniel ortega commentedHi, I have no relations and pager by month doesnt work
Comment #7
jurgenhaasThe latest commit contains a couple of typos/errors:
_blanlshould be_blankcalendar_query_filteringoption$this->view->query->addWhere(0, $conditions);needs to execute and should not be commented@matthieuscarset would you mind tagging a release for that? Would help a lot to continue with our internal development here.
Comment #8
heneryh commentedI'm experiencing this too. Thank you for looking into it.
Comment #9
matthieuscarset commentedOh... please forgive the inconvenience. I will make a new release asap (im away from the computer right now)
Comment #11
matthieuscarset commentedVersion 2.0.9 released.
Comment #12
matthieuscarset commented@daniel-ortega can you please give me more details about your View?
I'd like to test and reproduce the issue.
I reproduced the issue on Views with relationship - the query conditions apparently returns no results and I don't know why yet 🤷
But the conditions are working fine for any other simpler Views for me, without relationships.
Comment #13
heneryh commented@matthieuscarset
Dude, volunteers never have to apologize! I was just tagging along. I appreciate your efforts.
Comment #14
heneryh commentedI also had an issue with strange behavior in the CKE5 editor. Turns out there is some recent change to the way jQuery libraries work.
There is a small chance it might be related so it could be worth a peak at
https://www.drupal.org/project/drupal/issues/3222107
Comment #15
kenrbnsn commentedI can attest that content isn't being dispayed with paging turned on in version 2.0.9. When I turn off paging, I see my content, but then I have no way to go to the next month.
Comment #16
matthieuscarset commentedI'm sorry there are issues with the content not being displayed.
This is certainly caused by the query filtering added recently.
Can you please attest if the View works correctly if you disable this filtering?
To disable the filtering, open the Calendar settings, scroll down and uncheck the box saying Performance: filter query by dates.
Also, I still cannot reproduce this issue.
Can you please provide more context about your View?
Comment #17
heneryh commentedAre you talking about the page view settings?
because I don't see any performance settings.
Comment #18
kenrbnsn commentedI tried disabling that option and now it works properly. Note: I do not pull the date from a relationship (I have no relationships defined in my view). I am now running the latest dev version.
Comment #19
timme77 commentedPatch #5 works for me. Thx
Comment #20
heneryh commentedUhg, is there a quick composer hint someone can share? I need to google how to apply patches but I am not too proud to take a quick hint.
Nevermind, as of today, a composer update worked. I turned off that optional setting and it now works fine.
Comment #21
matthieuscarset commented@jjflynn22 i think you are running the latest version of this module.
Maybe the quickest way to help you right now is to use the dev branch which includes the fix:
composer require drupal/calendar_view:2.0.x-devMarking this issue as need work because there is obviously a bug with the query filtering and I need to dig into it.
Comment #22
jackfoust commentedSo in my quick look at this where I am seeing the issue with a specific content type not being shown when performance mode is on. My first content type is a smartdate, my second (not shown) is a datetime. The query that is being built in performance mode is comparing timestamps. Smartdate is stored as timestamps, but datetime is stored as a date string.
Comment #23
jamesgeldart commentedIt's really weird, but it seems like it's putting the start and end timestamps the wrong way round into the query:
The code looks fine, but when I swap the < and > round on lines 633 and 634 of src/Plugin/views/style/CalendarViewBase.php it works
Comment #24
jackfoust commentedInteresting, I may have to experiment with that on my end.
I've been testing the following patch to at least get this going for my specific use case, which seems to be working.
Comment #25
maxilein commentedI have the same problem. Thank you for all your work here!
Comment #26
matthieuscarset commentedNot sure I followed... which patch fix the issue?
Is it #23 or #24 or both 🤷?
Comment #27
jackfoust commented@matthieuscarset #24 is nothing official, I was just noting the workaround I used to proceed on how I needed to use the module.
Comment #28
maxilein commented@jamesgeldart I looked at the function that seems to create the sql.
I suppose it is the function public function getCalendarTimestamp() in line 174
Maybe the dataset in the background is not in the correct order. That could be the cause of the swapping? Just an inspiration.
Comment #29
matthieuscarset commentedTrying to summarize, i think these are issues to be addressed in order to fix calendar results when SQL query filter is enabled:
Marking issue as active. I am working on it.
Comment #30
matthieuscarset commentedWhile I was working on fixing the
queryfiltering in the Calendar View style plugin, I realized there are too many unknown about date fields and their values and results expected to be displayed too, depending on the date, the duration of events...etc.I think we should remove the
query()method from the Calendar style plugin itself and leave editors in charge of properly configuring the View in order to avoid performance issues - such as restricting results in the future when you have many unlimited recurrent events.Editors should be able to the use View filters to restrict the results of their calendars.
There is only one blocker I am trying to find the correct way of altering the value of filters to be able to use a custom Token (e.g. see this Slack thread + attached screenshot).
TL;DR
IMHO:
Comment #31
jurgenhaasI like the idea a lot to leaving the filtering to the site builder / view configurator. With regard to the date filtering following the pager, you could probably provide your own filter plugin, which extends the existing date filter from core and overrides the value field with the value that you can internally grab from the pager. So, you don't have to introduce a token, you can do that with a plugin that contains all the required logic.
Comment #32
matthieuscarset commentedRework of Calendar plugin done in this commit.
Changelog:
processResult()method bypopulateCalendar()(e.g. former method was convoluted and could produce duplicates/unwanted results)multiday.jslibrary for multiday events spanning on days in the past (e.g. start day not shown on the current calendar table)Any help testing the module again will be much appreciated.
Code is on the dev branch 2.0.x
Comment #34
matthieuscarset commentedTo complete this rework, we need to have a solution to filter dates in the past and future but this causes heavy loading time for large set of results (e.g. recurring events with no limits in time).
We need to make all date filters' values relative to the current Calendar timestamp
I think I have found a fix in this commit.
Date filters should now to follow the month/week navigation.
For instance:
Results: The content won't be displayed on the current week.
Solution: Change the offset to `-3 weeks` on the filter.
To limit results in the future, repeat the steps above but using the "Date range end field" and the "Less or equal than" operator.
Using date filters like this allow site builders to configure the View as usual, with the possibility to reduce the query in the past/future.
Comment #35
robotjox commentedI´m not sure I understand the current solution - but it doesn´t work for us.
We can´t set an offset for for instance "-1 year", because our users have to be able to see events from 5 years ago in the calendar.
But the calendar as it is now is far too slow because it has to load thousands of events.
So a "dynamic" page-filter - one that loads each month´s event every time you change to a new month - would be ideal.
Comment #36
matthieuscarset commentedThanks for the feedback @robotjox.
I understand the issue - and we made a few attempts to find a sustainable solution to this heavy loading.
The latest solution is on the latest release:
2.1.0and the choice was to leave the View results as-is, no query alter from the Calendar plugin. So, to answer your issue:Are you using
2.1.0?Can you test with a regular View (i.e. unformatted list)?
The View loading time and the list of results are not altered by the Calendar table.
Therefore you would need to configure the View correctly to fit your needs and then, select the Calendar display with the date filter.
Happy to help on Slack too because it is hard for me to debug things via comments on d.o.
Comment #37
maxilein commented2.1 did the trick for me. Thank you!
I can jump through weeks and through months.
Comment #38
matthieuscarset commentedMarking this issue as fixed now that
2.1.0is released.I've updated the module main page on d.o to reflect latest changes (i.e. how to configure date filters with offset value).
Thanks everyone for your help on this issue!
Comment #39
robotjox commented@matthieuscarset - thank you so much - new version seems to work perfectly with our many events :)