Fatal error: Call to undefined function: cal_days_in_month()

jonne.freebase - September 18, 2008 - 08:14
Project:Archive
Version:5.x-1.11
Component:Block
Category:support request
Priority:normal
Assigned:Unassigned
Status:needs review
Description

I got the above error when upgrading to the current version of the archive module. It's caused by the php install on our server that's way old (4.3.11). Anyway, I'm not sure if it's appropriate to include this in the main tree, but here's a patch that fixes the error in case you encounter it (by creating the function if it doesn't exist yet).

This patch seems to work on systems that have the cal function, and systems that don't.

AttachmentSize
archive.patch775 bytes

#1

supachaiMD - September 21, 2008 - 15:54
Category:bug report» support request

Thanks a lot jonne.freebase I got the same problem when applied it to Drupal 5.3. Anyway, Could you please let me know how to apply the patch?

Thanks in advance
supachaiMD.com

#2

travisdst - October 19, 2008 - 21:10

The patch works perfectly! Thank you.

To apply the patch, just make the "archive.module" source code at line 103 match what the "archive.patch" source code says by copying and pasting, then removing the preceding plus signs (+).

I'm novice so I can't explain it well technically, but I hope that helps!

#3

Raven2000 - November 15, 2008 - 11:23

Drupal 6.6 & Archive 6.x-1.3
add block Archive
Fatal error: Call to undefined function cal_days_in_month() in /usr/home/user/drupal/modules/archive/archive.module on line 106
=(

#4

sodafox - November 16, 2008 - 06:23

Oooh Thank you! Patch worked Great! I'm pulling my hair out, this was the easiest fix so far! I can't believe Drupal is so hard to set up with what you need!

#5

jonne.freebase - November 17, 2008 - 13:25

Keep in mind that the best solution is still to upgrade php to something more recent. There's no real reason to stick with php 4 nowadays (we finally upgraded our server to php5 too, and none of the sites that ran on it broke, even the ones that were way old).

To apply the patch, either use the unix patch tool, or paste any line that starts with a + into the file around line 356, and remove the + before each line.

Also, it's useless to ask questions to the original poster on drupal.org, because this forum thing has no e-mail notification, which makes it hard to follow up on your stuff.

#6

Ralf Saalmueller - May 5, 2009 - 12:42

I just run into the error and it looks like it's not everytime about the php version. The system has php version 5.2.6 with corresponding apache-mod-php and with archive-5.x.1-11 run into the error:
[Tue May 05 14:11:15 2009] [error] [client x.x.x.x] PHP Fatal error: Call to undefined function cal_days_in_month() in /srv/www/xxx/drupal/modules/archive/archive.module on line 359

But you should check if the php5-calendar extension is installed on your system ;-)

Read on: http://www.php.net/manual/de/calendar.installation.php

That made my day!

 
 

Drupal is a registered trademark of Dries Buytaert.