CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Event: Perfectly Valid Date Throws "Please select a valid start date" Error
Pages: [1]

Author Topic: Event: Perfectly Valid Date Throws "Please select a valid start date" Error  (Read 3946 times)

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Event: Perfectly Valid Date Throws "Please select a valid start date" Error
July 11, 2008, 06:22:18 pm
So, I've spent a lot of time setting up a Drupal 5.2 site running CiviCRM 1.9. I had a test event set up a few months ago, no problem. Now, however, setting up a new event, I can't get past the first page because  perfectly valid dates that I entered for start and end dates throw the "Please select a valid start date" Error. What could be causing this?
« Last Edit: July 14, 2008, 02:03:25 pm by farmrchrys »

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Event: Perfectly Valid Date Throws "Please select a valid start date" Error
July 15, 2008, 09:08:37 am
At this point I'd suggest upgrading your site to 2.0.5 since it's hard for us to debug prior versions. (I'm not aware of any bugs with regard to start date in 1.9 - but ...??).
Protect your investment in CiviCRM by  becoming a Member!

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Re: Event: Perfectly Valid Date Throws "Please select a valid start date" Error
July 15, 2008, 05:46:49 pm
Thanks, Dave,

Upgrading to 2.0 is not an option for me at this time. On this calendar issue, I suddenly noticed that as soon as I choose my first date element (usually the event start month), Firefox informs me of a script error. This is what the error report says:
Code: [Select]
document.getElementsByName("end_date[M]")[0] has no properties
defaultDate(select#start_date[m])event (line 393)
onchange(change )event (line 1)
[Break on this error] document.getElementsByName("end_date[M]")[0].value = document.getEl...

I get an error whenever I try and set a start date element, be it month, day, year or time but no error occurs when I enter the end date.

I don't know enough about the script for this to help me much. Hopefully you or someone else can explain what's gone wrong... And that it's repairable.

Chrys

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Event: Perfectly Valid Date Throws "Please select a valid start date" Error
July 16, 2008, 10:11:31 am
Possibly the code or template file for that form is corrupted ?? The error you're getting on submit is coming from the standard Quickform library date validation rule - so it's unclear what could be causing it to reject valid dates. The code which calls the rule is in CRM/Event/Form/ManageEvent/EventInfo.php on line 143 (in v1.9).

The javascript error is also weird - since the element that it claims is 'missing' ('has no properties') should be present in your form. Might be worthwhile doing View Source on the form and searching for the form field w/ that name.

Search the page source for: name="end_date[M]"

This SHOULD give you the <select> element for the End Date - Month drop-down.

If the expected fields aren't present - your could try copying in that template file from a 1.9 download/tarball which is still available from SourceForge (http://sourceforge.net/project/showfiles.php?group_id=177914&package_id=205038). The file is templates/CRM/Event/Form/ManageEvent/EventInfo.tpl
Protect your investment in CiviCRM by  becoming a Member!

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Re: Event: Perfectly Valid Date Throws "Please select a valid start date" Error
July 16, 2008, 11:48:05 am
Good Morning Dave,

I've been looking at the code for over an hour. Glad you got back to me just now. I think the issue MIGHT be that the value in question is end_date[M] and the error describes end_date[m] (lower case).

Could this be the problem? If so, I'm having trouble finding where the line
Code: [Select]
<select id="end_date[m]" name="end_date[m]">comes from in the source code for the add new event page. If I knew from which include file or javascript file that line came from, I can probably fix the problem. You think?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Event: Perfectly Valid Date Throws "Please select a valid start date" Error
July 16, 2008, 12:53:22 pm
Hmm - by any chance did u or someone there change the Input Date Field settings (Admin CiviCRM >> Global Settings >> Date Settings). This MIGHT be causing the problem. Check if the Complete Date and Time value is this: %b %d %Y, %I : %M %P

If that's not the problem - I'm stumped - you'll need to dig thru the code if you can't upgrade (or perhaps someone else will have some idea). The field is created by QuickForm library with format params from this function: CRM_Core_SelectValues::date().
Protect your investment in CiviCRM by  becoming a Member!

farmrchrys

  • I post occasionally
  • **
  • Posts: 92
  • Karma: 2
    • Spokane Moves to Amend the Constitution (under development)
  • CiviCRM version: CiviCRM 4.4.6
  • CMS version: Drupal 7.31
  • MySQL version: MySQL 5.5.37
  • PHP version: PHP 5.3.28
Re: Event: Perfectly Valid Date Throws "Please select a valid start date" Error
July 16, 2008, 02:16:56 pm
yyyyesssss  ::) I did, in fact, some time ago (at my data administrator's request), change the input date field month setting from %b to %m. Changed it back and now all seems fine. I guess she'll just have to live with Jan, Feb, Mar, etc. when inputting.

You and I both spent too much time on this, but I guess it's good to know changing that option has this effect.

I suppose it would be possible to edit something somewhere to allow that change to be made and still have the new event process work, but I'm behind and facing a deadline. It'll need to be someone else.

Thanks, Dave. Sorry to burden you.

Chrys

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: Event: Perfectly Valid Date Throws "Please select a valid start date" Error
July 16, 2008, 02:39:57 pm
Turns out there's an open issue for this - slated for 2.2 fix :-(
http://issues.civicrm.org/jira/browse/CRM-3087
Protect your investment in CiviCRM by  becoming a Member!

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviEvent (Moderator: Yashodha Chaku) »
  • Event: Perfectly Valid Date Throws "Please select a valid start date" Error

This forum was archived on 2017-11-26.