Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
Upgraded from 7.x-2.9-alpha2 to beta1 and norice that my server log is now showing the following notice:
Undefined variable: granularity in date_views_plugin_pager->query() (line 285 of //modules/date/date_views/includes/date_views_plugin_pager.inc).
May or may not be related to also having upgraded Views to 7.x-3.7+38-dev to solve another issue.
This is on a production site but there is not noticeable impact.
Has anyone else come across this issue.
Steps to reproduce
- Create a view with page
- Use a date field as argument
- Use date pager. Make sure 'Skip empty pages' is not checked.
Proposed resolution
Fix the PHP warning.
Remaining tasks
- write test case - Make sure it fails without fix
- Create a patch to fix the failed test case
User interface changes
No more warning.
API changes
N/A
Comment | File | Size | Author |
---|---|---|---|
#40 | date-2372073-views_pager_warning-40.patch | 3.84 KB | vijaycs85 |
Comments
Comment #1
nimbletoad CreditAttribution: nimbletoad commentedJust ran into this issue as well. Updating to 7.x-2.9-beta1. No solution yet and we have also seen no impact.
Comment #2
lvthunder CreditAttribution: lvthunder commentedI have this too except it shows on the screen to everyone. I upgraded to Date 7.x-2.9-beta1 and Core 7.33 via drush.
I also just found the way to turn the errors off so that's good.
Comment #3
MXTSame issue here.
Comment #4
MXTNoticed just now a further bad consequence: my calendar (module) pagination between months (or years) does not work anymore.
Mark this as major
Comment #5
jakemonO CreditAttribution: jakemonO commentedpager also broken in mine. had to roll back the install
Comment #6
Lostboy22 CreditAttribution: Lostboy22 commentedEasy fix.
change 283-285
to
Comment #7
Lostboy22 CreditAttribution: Lostboy22 commentedComment #8
Lostboy22 CreditAttribution: Lostboy22 commentedComment #9
IBouglas CreditAttribution: IBouglas commentedPatch works for me. Many thanks to Lostboy22.
Comment #10
MXTPatch in #7 resolve all issues for me.
Thank you very much.
Comment #11
maximpodorov CreditAttribution: maximpodorov commentedPlease commit.
Comment #12
maximpodorov CreditAttribution: maximpodorov commentedPatch in #7 is renamed according to patch name rules.
Comment #13
BBCPatch #12 worked for me. Thanks.
Comment #14
k.skarlatos CreditAttribution: k.skarlatos commented+1, works for me
Comment #15
tvl CreditAttribution: tvl commentedPatch #12 worked for me. Thanks.
Comment #16
caspervoogt CreditAttribution: caspervoogt commentedPatch #12 works for me too. RTBC in my book
Comment #17
marcel.jtf CreditAttribution: marcel.jtf commentedPatch #7 worked perfectly for my sites and no more errors.
Comment #18
danwonac CreditAttribution: danwonac commentedPatch #12 works for me to. However, this exposed a new bug whereby paging forward a month results in skipping months.
Comment #19
Acertijo CreditAttribution: Acertijo commentedthanks #7
Comment #20
david_garcia CreditAttribution: david_garcia commented+1 RTBC
Comment #21
DamienMcKennaJust confirming that the patch still applies to -dev.
Comment #23
joebest CreditAttribution: joebest commentedPatch worked fine on my site. Thanks!
Comment #24
sgurlt CreditAttribution: sgurlt commented#12 works perfect for me!
Comment #25
jox CreditAttribution: jox commentedPatch #7/#12 works, thanks Lostboy22.
Comment #26
rwilson0429 CreditAttribution: rwilson0429 commentedPatch in #12 works great. It also fixed a problem I was experiencing of the date pager not working properly in the Calendar module's month and week view displays. Thanks Lostboy22 and maximpodorov.
+1 RTBC
Comment #27
danreb CreditAttribution: danreb commentedPatch #12 works for me too +1 RTBC
Comment #28
Plazik CreditAttribution: Plazik commented#12 works for me too.
Comment #29
Funksmaname CreditAttribution: Funksmaname commented#12 worked for me too.
Comment #30
iStryker CreditAttribution: iStryker commented#12 works for me too
Comment #31
schifazl CreditAttribution: schifazl commented#12 works, thanks! Hope that it'll get committed soon!
Comment #32
vikramy CreditAttribution: vikramy commented#12 works for me on dev version.
Comment #33
Ether CreditAttribution: Ether commentedPatch is good, but when it will be in dev version ?
Comment #34
erwangel CreditAttribution: erwangel commented#12 worked for me on Date 7.x-2.9-beta2. No more php notices in logs and calendar pagination works fine (year, month, week and day verified)
Comment #35
kingfisher64 CreditAttribution: kingfisher64 commentedLike #33 said - when will this be committed to dev?
Tested latest dev ( 2015-Mar-04 ) and it's still outputting the error.
Patch FIXES this. :)
Please commit this mr maintainer!
Thanks
Comment #36
vijaycs85Comment #37
vijaycs85Comment #38
vijaycs85Here is a test-only patch that would fail without fix.
Comment #40
vijaycs85Here is the fix (with test).
- Fixed one more warning on title
- Removing #12 changes that not related to this issue
- Added test coverage.
Comment #41
stefan.r CreditAttribution: stefan.r commentedTest looks good!
Comment #42
szt CreditAttribution: szt commented#40 works!
Comment #43
podarokthanks, #40 commited