- Issue created by @alex0412
Thank you for reporting this issue. I am not sure to understand though.
Are you talking about the navigation by month or another pager ?
If you view uses Ajax, any error in the console ?
Can you share more info about how your view is configured ?
Regarding the demo, it s a static site and no dynamic things such as the pager or search work. There should be a disclaimer to explain it, sorry about that.
- Status changed to Postponed: needs info
over 1 year ago 7:33pm 8 March 2023 - π«π·France luluthegeek
I am experiencing the same problems with a fresh install of Drupal 9.5.4 and calendar_views 2.0.5.
I can change month once with the pager, but then any new action is not successful and I stay on the same month. The previous, next and today links on the pager all have the same URL :
evenements?previous=1675799408¤t=1678218608&next=1680893408&date_format=custom&date_pattern=F&display_reset=1&calendar_timestamp=1680893408
I have this problem with the themes Olivera and Claro, and AJAX enabled or disabled.
Thank you for your help...
- Status changed to Active
over 1 year ago 10:52am 9 March 2023 Thank you for reporting the issue with details.
I am still trying to reproduce the error. I've made a fresh install on Drupal 9.5.3 with version 2.0.5.
Installed
calendar_view_demo
and tested the Editorial calendar view.Pagination links work all the time, even after multiple clicks, meaning the current timestamp is correct in parameters.
Trying to investigate in code directly but I can't figure out what cause your issue with the timestamp.
- π§πͺBelgium herrzhull
Is the a chance it's a Drupal 9.5.4 thing? My test was on 10.0.4. And perhaps as not everyone is reporting the issue it's a recent thing?
- π©πͺGermany alex0412
I disabled all caches just to make sure that it's not related to that, but the issue is still there.
- π©πͺGermany alex0412
I think I have found the bug.
It's inside the "template_preprocess_calendar_view_pager" preprocess function, where the query params are "merged" with the correct "calendar_timestamp" param for the next/prev/reset link:
'#url' => Url::fromRoute($route_name, [], [ 'query' => $parameters + ['calendar_timestamp' => $parameters['next']], ]),
The order of this "+" operator is wrong. PHP documentation:
The + operator returns the right-hand array appended to the left-hand array; for keys that exist in both arrays, the elements from the left-hand array will be used, and the matching elements from the right-hand array will be ignored.
As the "calendar_timestamp" key was already inside $parameters, the intended override didn't work. The fix is easy, just revert the order.
Why you can't reproduce this bug @matthieuscarset is weird though...
- π«π·France luluthegeek
I think the bug appeared with the update from Drupal 9.5.3 to 9.5.4.
I downgraded my Drupal 9.5.4 to 9.5.3 and installed calendar_view_demo : all is working fine, and the links in the pager are ok :
next : /calendar?created=-1%20year&title=&type=All&status=All&langcode=All&previous=1680300000¤t=1682892000&next=1685570400&date_format=custom&date_pattern=F&display_reset=1&calendar_timestamp=1685570400 reset : /calendar?created=-1%20year&title=&type=All&status=All&langcode=All&previous=1680300000¤t=1682892000&next=1685570400&date_format=custom&date_pattern=F&display_reset=1&calendar_timestamp=1677625200 previous : /calendar?created=-1%20year&title=&type=All&status=All&langcode=All&previous=1680300000¤t=1682892000&next=1685570400&date_format=custom&date_pattern=F&display_reset=1&calendar_timestamp=1680300000
Then, I updated Drupal 9.5.3 to 9.5.4, and the bug appeared again on calendar_view_demo.
- π©πͺGermany alex0412
Ah, that's interesting! Maybe this commit from 9.5.4 is related to it, at least it's about view pagers: https://git.drupalcode.org/project/drupal/-/commit/3664a3d4b49f900f617d9...
- First commit to issue fork.
- @tar_inet opened merge request.
- πͺπΈSpain tar_inet
I tried in Drupal 9.5.2 and I canΒ΄t replicate it either but I did in 9.5.4.
Fix #13 makes sense and works to me so I created a PR from it to help on the process. I added @alex0412 in the comment of the commit to make sure he gives attribution
https://git.drupalcode.org/project/calendar_view/-/merge_requests/12 - πΊπΈUnited States kenrbnsn New Jersey
I applied the diff code (patch) to my site and it fixed the problem. Drupal: 9.5.4, PHP 8.1.16
- Status changed to RTBC
over 1 year ago 7:28am 14 March 2023 - π©πͺGermany jurgenhaas Gottmadingen
+1 RTBC on #13, this fixes the problem for me too and I was just about to propose the exact same patch.
- @tar_inet opened merge request.
-
matthieuscarset β
committed eeedf022 on 2.0.x authored by
tar_inet β
Issue #3345696 by tar_inet, alex0412, herrzhull, luluthegeek, jurgenhaas...
-
matthieuscarset β
committed eeedf022 on 2.0.x authored by
tar_inet β
- Status changed to Fixed
over 1 year ago 2:08pm 14 March 2023 Woua thank you very much all for finding and fixing the issue. I definitely did not manage to reproduce it...
I'm merging the changes and it will be shipped in a new release soon.
- π΅π±Poland mornel
Thank you guys, works for me too @ Drupal 10.0.4!
Small suggestion: it would be nice to have a class on the current day. Cheers!
I reproduced the bug locally yesterday while working on this other issue β¨ Add support for week calendar display Fixed .
I have fixed the pagination by changing some things in the way we retrieve the calendar timestamp (e.g.
getCalendarTimestamp()
method).The final fixed version will be release soon - depends on the other issue.
- π¦πΉAustria attisan Vienna
I'm a bit at a loss here. using the latest dev the issue is still present - but the patch from MR 12 does not apply (I guess as it is already been merged?).
- π¦πΉAustria attisan Vienna
@mornel
Small suggestion: it would be nice to have a class on the current day. Cheers!
see β¨ Add weekday classes and week numbers Fixed . Would love some reviews π.
- Status changed to Fixed
over 1 year ago 11:49am 18 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.