Hey there,

I've installed this module. When I add an event I get this error:

# warning: checkdate() expects parameter 3 to be long, string given in /home/public_html/modules/event/event.module on line 1699.
# De opgegeven datum is ongeldig.

(# De opgegeven datum is ongeldig. == in dutch == The date is not valid)

Am I doing something wrong?

I tried to enter the start date as:
12 September 2008
(I selected the month with dropdown menu)

When the systems saves this event, the date is: 00/00

Hope someone can help me!

Kind regards,

Ralf

CommentFileSizeAuthor
#5 event.module-5.x-2.x-dev_5.patch173 bytessmccabe
#3 event.patch2.1 KBgengel
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

aaron’s picture

Having the same issue. I'll post a patch if I can track down the bug.

aaron’s picture

Looks like it's running both the start and end date through the validation. If you don't have a year set for the end date (or for either, for that matter), it's trying to send an empty string to checkdate, which complains because it expects an integer.

Unfortunately, the end date is sent for validation even if you don't check the 'Event has end date' box, which is the root of the problem.

gengel’s picture

Status: Active » Needs work
FileSize
2.1 KB

Not sure if this is the right approach generally, but here's a patch that works for my purposes.

I added a #skip_validate property to the event form element, which can be set to true in forms where you don't want validation to instantly apply. Then, in hook_form_alter for the node_form, I set that prop to true for the second date. Then implemented event_validate_form to examine the checkbox and validate the element only if it was checked.

gengel’s picture

Category: support » bug
smccabe’s picture

Status: Needs work » Needs review
FileSize
173 bytes

here is a very simple patch to have the end validation only run if the end date checkbox is checked. If i understand the problem this is a much smaller fix for the same problem.

killes@www.drop.org’s picture

The end date has a default date send which should not affect the validation process. Can somebody try to add casts to ind in the checkdate call?

ie:

if (!checkdate((int)$form['#value']['month'], (int)$form['#value']['day'], (int)$form['#value']['year'])) {
form_error($form, t('The specified date is invalid.'));
}

killes@www.drop.org’s picture

Status: Needs review » Fixed

I've applied gengel's patch with modifications.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.