Posted by caomhin on January 1, 2009 at 9:26am
| Project: | Archive |
| Version: | 5.x-1.x-dev |
| Component: | Miscellaneous |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Issue Summary
This morning I was greeted by an error saying there was an incorrect date on line 106. The following change appears to work:
if($month==1) {
$num_days_prev = cal_days_in_month(CAL_GREGORIAN, 12, $prev_year);
} else {
$num_days_prev = cal_days_in_month(CAL_GREGORIAN, $month-1, $year); // orig code
}
Comments
#1
same same:
warning: cal_days_in_month() [function.cal-days-in-month]: invalid date. in /homez.59/my_DB_name/www/sites/all/modules/archive/archive.module on line 106.I've tried to replace line 106 by your code:
#2
Same issue here but the code appeared to fix the problem.
Thanks.
#3
I used your solution with version 5.14 and fixed the warning of cal_days_in_month,,
I just removed the comment in the original code line because leaving it causes a Parse error;
so, my final code is like this:
if($month==1) {$num_days_prev = cal_days_in_month(CAL_GREGORIAN, 12, $prev_year);
} else {
$num_days_prev = cal_days_in_month(CAL_GREGORIAN, $month-1, $year);
}
#4
just fixing the forum title to a better search :)
#5
just fixing the forum title to a better search :)
#6
Same error here on latest 5.x Drupal core and latest version of this module.
Made the change indicated above by hand, and the errors have cleared.
#7
The fix is also a possible solution to the same problem with drupal 6.8.
#8
A better patch for the 6.x one at least (I don't have 5.x to test with):
// OLD: $num_days_prev = cal_days_in_month(CAL_GREGORIAN, $month-1, $year);$num_days_prev = cal_days_in_month(CAL_GREGORIAN, $prev_month, $prev_year);
It only requires the one line because the current version of the 6.x branch already works out what last month was and what year it was in and assigns it to the prev_month and prev_year variables.
#9
i tested it on 5.x and it doesn't work for me.(#8)
the other patch is perfect.(#3)
thanks all!
#10
Hello,
I had the same issue but solved now. I tried the mdin617's patch (Drupal 6 too) and it worked perfectly.
Thank you very much!
#11
same issue here:
cal_days_in_month() [function.cal-days-in-month]: invalid date. in sites/all/modules/archive/archive.module line 359.
PHP version is 5.2.6-5, Drupal core 5.14, archive module 5.x-1.11.
solution #3 by sietecoyote worked fine, patch file is attached.
#12
This is more correct fix:
$num_days_prev = cal_days_in_month(CAL_GREGORIAN, $prev_month, $prev_year);#13
according to #9, this one-liner doesn't work on Drupal 5.
#14
The solution @ #12 did the trick for archive module 6.13
Thanks
Stephen
#15
Solution #12 made my day!
Archive 6.x-1.3
Drupal 6.15
MySQL database 5.0.77
PHP 5.2.10
Web server Apache
Thanx!
#16
#8/#12 worked for me as well in 6.14 (upgrading to 6.15 right now, but that shouldn't change anything).
Could someone commit this change to the 6.x branch? That would save lots of time for anyone just starting to use the Archive module on 6.x.
And solution in #3 (with patch in #11) seems to work for the 5.x branch, if anyone still needs that.
#17
+1 for #16
#18
subscribing... please add to next 6.x release
#19
#12 tested on Drupal 6.15. Fully functional.
#20
Nice module, but doesn't work in January ROFL!
None of the solutions works for me :/
#21
#8 (#12) still works fine in January with Drupal 6.15, so Shaman - double-check if you did properly apply the fix and cleared the cache.
#22
It's February soon, so I'll wait till next year, perhaps there'll be some update in this module :D
#23
Fixed for the 6.x branch/7.x-branch. If someone wants this fixed in the 5 version please provide a patch.