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 |
---|---|---|---|
#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 |
#16 | 2867991-16.patch | 1.67 KB | Suresh Prabhu Parkala |
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 CreditAttribution: jeremylichtman as a volunteer and for Cheeky Monkey Media 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 CreditAttribution: jeremylichtman as a volunteer and for Cheeky Monkey Media 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 CreditAttribution: 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 CreditAttribution: jedsaet as a volunteer commentedStraight re-roll of #5.
Comment #9
rokzabukovec CreditAttribution: rokzabukovec at Agiledrop - Your Trusted Drupal Teammates 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 CreditAttribution: nikitagupta at Srijan | A Material+ Company for Drupal India Association commentedfixed coding standard errors.
Comment #13
nikitagupta CreditAttribution: nikitagupta at Srijan | A Material+ Company for Drupal India Association commentedComment #14
Neslee Canil PintoPatch needs reroll
Comment #15
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedComment #16
Suresh Prabhu Parkala CreditAttribution: Suresh Prabhu Parkala at Specbee commentedRe-rolled patch please review.
Comment #18
kyoder CreditAttribution: kyoder commentedHere's an updated patch.
Comment #19
manishsaharan CreditAttribution: manishsaharan at Specbee 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 CreditAttribution: igork96 at Agiledrop - Your Trusted Drupal Teammates 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 CreditAttribution: solideogloria commentedIssues should target dev. Test the patch with dev, not just alpha
Comment #23
igork96 CreditAttribution: igork96 at Agiledrop - Your Trusted Drupal Teammates commentedHere is a patch against 8.x-1.x-dev for testing.
Comment #24
mortona2k CreditAttribution: mortona2k as a volunteer 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.