When I use the CCK date field in my node and set it to use unlimited multiple values, the jquery popup calendar fails after I click the "add another item" button. After the AHAH call an error message appears stating

"warning: preg_match() expects parameter 2 to be string, array given in /modules/date/date_api.module on line 1000."

Once this error appears the jquery popup calendar no longer works on any field.

I am using the latest Drupal 6.2, CCK, views, date and token. This is a clean install on my Mac with Leopard.

Comments

Vallenwood’s picture

I'm having exactly the same problem. It still exists in 6.x-1.0-beta3. It only occurs for me when there is more than one instance of a date (i.e. when you set the "Number of values" to be Unlimited and click the "add another" button). This is the error I receive:

    * warning: preg_match() expects parameter 2 to be string, array given in /home/----/public_html/modules/date/date_api.module on line 1080.
    * warning: preg_match() expects parameter 2 to be string, array given in /home/----/public_html/modules/date/date_api.module on line 1080.

These are the steps to replicate the error:

  1. Create a new content type, "Event"
  2. Add a new field
  3. Chose "datetime" for the field type
  4. Choose "text field with jQuery popup calendar"
  5. Set some basic options: default value "Now," field "required," Number of values to "Unlimited," To date to "Optional"
  6. Submit the configuration
  7. Create content "Event"
  8. Click in the date field and the jQuery calendar pops up fine
  9. Click "Add another item" or however it's worded
  10. BAM! Error message shows up, and jQuery calendar no longer works.

If you follow the exact same steps but select "date" instead of "datetime" the error no longer appears; however, the field still loses its jQuery calendar and no default times are entered. (Not only that, but it displays exactly the same whether "date" or "datetime," so what's the difference anyway? Haven't figured that out.) So basically this whole routine is screwy.

I have CCK 6.x-2.0-beta, PHP 4.4.7, Drupal 6.2

Modules:
CCK: Content, Content Templates (6.x-0.13), Fieldgroup, Option Widgets, Text
Depends on: Content (enabled)
Required by: Node Reference (disabled), User Reference (disabled)
Text
Core: Taxonomy, Update status, Upload
Date: Calendar, Date, Date API, Date PHP4, Date Popup, Date Repeat API
Other: Advanced help, FCKeditor, Token (6.x-1.10)
Views: Views, Views UI (6.x-2.0-beta4)

Thank you!

karens’s picture

Status: Active » Fixed

This is an old issue and there have been lots of changes since then. I don't see any problems like this in the latest -dev code. This may be related to another issue about the popup breaking when you add more fields, and that issue was fixed today.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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