When you have a calendar view created from template. When you use the pagination, the tabs no longer work.
E.g. you go to your calendar/day page and go to the next day. The URL shift to /calendar/day/20170409. This means the tabs are also formed similarly. E.g. /calendar/month/20170409 for the month tab. This URL doesn't work, because the month expects something like /calendar/month/201704
Changing the contextual filters so e.g. the month display uses the full date, makes sure not the entire month is shown.
This seems related to behaviour in core where arguments are added to the tabs when using them, so unsure on how to fix this.
| Comment | File | Size | Author |
|---|---|---|---|
| #25 | calendar-2867991-tab_navigation-25.patch | 2.58 KB | mortona2k |
| #23 | calendar_tabs- 8.x-1.x-dev-2867991-23.patch | 2.58 KB | igork96 |
| #20 | calendar_tabs-2867991-20.patch | 3.82 KB | igork96 |
| #19 | calendar_tabs-2867991-19.patch | 2.95 KB | manishsaharan |
| #18 | calendar-tabs.patch | 888 bytes | kyoder |
Issue fork calendar-2867991
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
sleepingmonkCalendar View Date Arguments cause Page not found when argument string is longer than format expects:
i.e.
argument = 20170523 (Ymd)
validation_format = 'Ym'
Either in link generation (view tabs) or in argument validation, we need to alter the argument value to match the expected validation format.
YW format already tries to do something like this:
FROM DateArgumentWrapper.php
I will continue to work on this and provide a patch as soon as I can.
Comment #3
jeremylichtman commentedJust started tracing the issue.
I put some kint statements in createFromFormat to see what it is doing.
It appears to take the date format from the current view display, rather than trying to determine the type of display that the tab would be for.
This is an obvious statement, but it may be tricky to try to obtain the correct formats out of the view, since the tabs at that point consist only of a path and a string (i.e. "Month" - which could be translated as well).
Comment #4
jeremylichtman commentedThe following is a work-around, since it is overriding the tabs instead of re-architecting how the calendar module creates them in the first place. The code deals with url params (i.e. form options) as well. In a production environment, this should probably be refactored into a set of helper functions.
Comment #5
pslcbs commentedHi,
I think this issue is fixed with attached patch.
Inactive tabs now have clean paths without incorrect dates after using pagers.
I don't know if is the best approach but it works for me.
Comment #6
neslee canil pintoComment #7
jedsaet commentedStraight re-roll of #5.
Comment #9
rokzabukovec commentedThe patch from #7 applied cleanly and works but it has some problems with coding standards. I applied the patch and fix coding standard errors and created a new patch. See interdiff for details. Marking this as "Needs review".
Comment #11
nikitagupta commentedfixed coding standard errors.
Comment #13
nikitagupta commentedComment #14
neslee canil pintoPatch needs reroll
Comment #15
suresh prabhu parkala commentedComment #16
suresh prabhu parkala commentedRe-rolled patch please review.
Comment #18
kyoder commentedHere's an updated patch.
Comment #19
manishsaharan commentedAfter applying #18 patch, tabs were working fine, but there are some another issues for Year Calendar.
To reproduce that apply #18 patch and click on Year tab
This patch fixes all of these issues.
Test with Drupal 9.4 and Calendar 8.x-1.0-alpha4 version
Comment #20
igork96 commentedI reroled the patch from #19, it was breaking the style and it had warning error when you visit the year view of the calendar. Test with Drupal 9.4 and Calendar 8.x-1.0-alpha4 version.
Comment #21
solideogloria commentedIssues should target dev. Test the patch with dev, not just alpha
Comment #23
igork96 commentedHere is a patch against 8.x-1.x-dev for testing.
Comment #24
mortona2k commentedPatch #23 fixed it for me. It works by altering the local tasks and removing extra arguments from the path. Maybe we should check in the css changes separately if those aren't necessary for this.
Comment #25
mortona2k commentedUpdated patch so it applies to beta2.
Comment #26
joelpittetThanks for keeping this up-to-date, I would agree with you that the CSS stuff needs to be moved to a separate fix if it's needed.
Issue summary could explain this better
Comment #27
kopeboyI see no mention of CSS issue in the summary nor in the patch, which does the job! Thank you! +3
Comment #28
joelpittetThere is still CSS code in the patches. This still needs work.
Comment #30
mortona2k commented2867991-tab_navigation_fix branch is going back to the fix from #5.
With just this, the date contextual arguments are stripped from the other tabs so they are not broken.