Date repeat in D7.12:

- Create a new content type with a Date field, select list widget, with repeat option
- Create a node without changing the date in the list widget, set the weekly repeat count to 9 times
- Save the node

Warning: implode(): Invalid arguments passed in implode() (line 1616 of /srv/http/d7.rovin.be/includes/form.inc).

Devel module gives this info

18: implode() (Array, 1 element)
args (Array, 2 elements)
0 (String, 2 characters ) ][
1 (NULL)
17: form_error() (Array, 2 elements)
file (String, 22 characters ) includes/form.inc:1616
args (Array, 2 elements)
0 (NULL)
1 (String, 84 characters ) Date repeat: this ...
16: date_field_widget_error() (Array, 2 elements)
file (String, 38 characters ) sites/all/modules/date/date.module:386
args (Array, 4 elements)
15: field_default_form_errors() (Array, 2 elements)
14: _field_invoke() (Array, 2 elements)
13: _field_invoke_default() (Array, 2 elements)
12: field_attach_form_validate() (Array, 2 elements)
11: entity_form_field_validate() (Array, 2 elements)
10: node_form_validate() (Array, 2 elements)
9: form_execute_handlers() (Array, 2 elements)
8: _form_validate() (Array, 2 elements)
7: drupal_validate_form() (Array, 2 elements)
6: drupal_process_form() (Array, 2 elements)
5: drupal_build_form() (Array, 2 elements)
4: drupal_get_form() (Array, 2 elements)
3: node_add() (Array, 2 elements)
2: call_user_func_array() (Array, 1 element)
1: menu_execute_active_handler() (Array, 2 elements)
0: main() (Array, 2 elements)

Comments

karens’s picture

Status: Active » Postponed (maintainer needs more info)

I am unable to reproduce the problem following the steps listed using the latest dev code so there is nothing I can do with this report, nor is anyone else reporting this.

Try it on a fresh install with just the Date module and nothing else. If you can't reproduce the error that way you have something else causing the problem -- some other module or something about the configuration. You'll have to try to figure out how it can be reproduced on a fresh install because that's the only way we can do anything with it.

bart.hanssens’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

After a fresh install (even with all previous modules enabled), I cannot reproduce it either, so I just close this one

lunk rat’s picture

Version: 7.x-2.x-dev » 7.x-2.2
Status: Closed (cannot reproduce) » Active

I can reproduce it:

  1. Add a date field but do not set repeat option. Set number of values to 1.
  2. Create a node with a date value
  3. Delete the node
  4. Edit the date field and set repeat option to Yes
  5. Create a node with a date value and repeat it
  6. Save the node
  7. watch it puke

At this point I get the implode error and it fails to create the repeated date values.

Seems you have to create the date field with repeat set to No, then turn it on later in order to get the bug.

dlshannon’s picture

I have just received the same error. And, I've been fiddling with the repeat option (trying to figure out how to get both the Repeat option for consistently repeated events and the Add button for multi-day events with different times). I can't remember all of my steps but it could easily have included the steps Lunk Rat described in #3.

karens’s picture

Version: 7.x-2.2 » 7.x-2.x-dev
Status: Active » Closed (cannot reproduce)

Unable to reproduce in the latest code (which is the dev version, not 2.2).

SheilaRuth’s picture

Status: Closed (cannot reproduce) » Active

I'm having this exact same problem. Is there any way to get this reopened? I installed date on a site that I upgraded from Drupal 5 -> 6 -> 7, and at first I thought the error might be because of legacy data from the old event module. I deleted all content which used the old event-based content type, removed the content type, and then tried creating a new content type with a date field. When I tried to create content with a repeating date for the new content type, I got the same error. Creating content with a non-repeating date works fine.

I tried disabling the date and calendar modules, and then uninstalled them completely. I also uninstalled any modules that I'm not actively using. Then I renabled just the bare minimum modules I needed to make this work: date API, Date, Date Repeat API, and Date Repeat Field. I didn't enable any other date or calendar modules, just to make sure there were no conflicts.

I don't think the issue is with setting the initial repeat to "No" as Lunk Rat suggests. I'm pretty sure I've tried it both ways: setting it to "No" then changing it, and setting it to "Yes" initially, as I've deleted and recreated the content type numerous times.

A clean install is not an option for me for this site. I have to be able to get this site upgraded, and I really need the date module. I've spent days upgrading, and have everything working except this one thing.

Can anyone suggest any other things to try?

TIA

SheilaRuth’s picture

Status: Active » Closed (cannot reproduce)

Well, it seems that the error has disappeared and I can no longer reproduce it either. I don't know what I did that fixed it, unfortunately. I tried backtracking everything I'd done, but nothing made the error come back. So I'm setting this back to closed, and I'm sorry I couldn't be more help in tracking it down.

drupalninja99’s picture

I can reproduce in 2.5. I did a trace to see the actual error and the error is this "[Field name]: this field cannot hold more than 1 values." The $element variable is blank for some reason which is throwing the implode error.

drupalninja99’s picture

Status: Closed (cannot reproduce) » Needs work
drupalninja99’s picture

OK I think I figured it out. On OpenChurch I had a normal date field and I created this field before I enabled the date repeat field module. After enabling that module I delete all my event content and changed the settings to allow repeats. When I created new event content I started getting these implode errors and the repeat logic wasn't working.

So what I did that fixed it is I deleted the field, and created it again from scratch. The settings were the exact same. Then I went back and recreated an event. This time it worked. My guess is that existing date fields need to be updated in the database when converted to a repeat field, otherwise this problem will occur.

dlshannon’s picture

Version: 7.x-2.x-dev » 7.x-2.5
StatusFileSize
new40.51 KB
new104.54 KB
new97.74 KB
new91 KB

Is it not allowed to have 2 date fields? I started getting the php error listed in the original post as soon as I added a second date field.
Why 2 date fields, you ask? I have recurring events (performances) that take place at 8pm on Fridays and Saturdays and 2pm on Sundays. I currently define two events for each performance - one for the 8pm showings and one for the 2pm showings. That has its own undesirable consequences so I tried to adding a second date field so that I can define an event once instead of twice. The error appears whenever I save an event now.
If we aren't supposed to have 2 date fields, is there another way of letting us know that, other than that php error?
I'm certainly not a expert but if people are having a difficult time repeating the errors that others produce easily, I'm wondering if it has to do with how we've configured our dates. So, I've attached some screenshots of how mine are configured and how I'm using them. If you need more, just let me know. I'm on 7.x-2.5. (I did not test it on the dev version because, frankly, I can't figure out how to load the dev version. It must be easy because people tell you to do it without explaining how to do it. But, it has me stumped.)
Thanks.

zeropx’s picture

drupalninja99:

OK I think I figured it out. On OpenChurch I had a normal date field and I created this field before I enabled the date repeat field module. After enabling that module I delete all my event content and changed the settings to allow repeats. When I created new event content I started getting these implode errors and the repeat logic wasn't working.

So what I did that fixed it is I deleted the field, and created it again from scratch. The settings were the exact same. Then I went back and recreated an event. This time it worked. My guess is that existing date fields need to be updated in the database when converted to a repeat field, otherwise this problem will occur.

I tried these steps and it worked great. Just confirming this technique/work around.

drakythe’s picture

Status: Needs work » Closed (duplicate)

Seems we have come to the same conclusion, I'm gonna go ahead and mark this one as a dupe of #1391464: Setting repeat of date field after initially creating field results in "Invalid arguments passed in form_error()"