Something is wrong with Date+CCK.

When I try to create content (custom with date field) I got this
@ http://mysite.com/node/add/custom_content
Fatal error: Cannot unset string offsets in /path/to/sites/all/modules/date/date/date_elements.inc on line 277

And also when I go to edit custom conent date field I've got
@ http://mysite.com/admin/content/node-type/custom_content/fields/field_pu...
Fatal error: Cannot unset string offsets in
/path/to/sites/all/modules/cck/includes/content.node_form.inc on line 71

No problems with other CCK fields however.
Using CCK 6.x-2.4 and 6.x-2.x-dev (before dev I've used latest stable version but decided to check if dev has the same problem)

However published content works as it should only can't publish anything new with content types which uses date field(s).

Comments

ctrnz’s picture

Enabling modules
Date Locale
Date Popup
Date Repeat API
resloves the issue. However - I don't need these modules and before update those were disabled.
It seems that one of them is mandatory I can play later to see which one exactly.

kyle_mathews’s picture

I had the same problem. Installing Date Repeat API solve that problem. I think the problem is we can create an date field that can repeat w/o actually installing the Date Repeat API and only run into problems when we try to create a node.

arlinsandbulte’s picture

Priority: Critical » Normal
Status: Active » Postponed (maintainer needs more info)

Is this still valid?

How can a date field be created "that can repeat without actually installing the Date Repeat API"?

fizk’s picture

Status: Postponed (maintainer needs more info) » Active

Thanks kyle_mathews, enabling the Date Repeat API solved it for me too.

This should be fixed, probably by adding Date Repeat API as a dependency for one of the date modules.

Anonymous’s picture

I encountered this issue when I used Features to install a content type that used Date Popup.

I hadn't enabled Date Popup and when I went to create a new content type, I got the error mentioned in the original post.

This is obviously an edge case, though. I just wanted to contribute my experience in case it helps figure out the origin of the issue for others.

ezra-g’s picture

karens’s picture

Status: Active » Postponed (maintainer needs more info)

If you don't have Date Repeat enabled there is no option to create a date_repeat widget, so the only way this could happen that I can see is that you had it enabled, created a date field, and then disabled it?

karens’s picture

Status: Postponed (maintainer needs more info) » Closed (fixed)

No response.

niklp’s picture

Status: Closed (fixed) » Active

After spending 4 hours trawling through FormAPI trying to get my head around this and failing, I finally stumbled across this node.

This issue is still present in 6.x-dev (and probably 7.x) at 30 Nov 2011.

You're correct in your conclusion above that basically I "had it enabled, created a date field, and then disabled it", which is perhaps nuts, but the bottom line is, it happened.

The assumed outcome of this was that I expected the data repetition to simply vanish. The actual outcome was it broke all pages with forms with dates on them. This is pretty harsh, to be fair.

Obviously if one is disabling a module then it's kinda harder to check for dependencies, but is there any way to check that if a module is necessary, it's enabled?

I'm pretty sure this is date repeat module causing this, but date popup is also mentioned. I can only say the following weird combination of things occurred after reading this thread and I am very confused.

Found error.
Traced stuff through form api for hours, to no avail.
Found this post.
Checked modules : date popup, date repeat api were disabled
Enabled both
Checked error = gone
Disabled date popup = couldn't see the date field at all(?) to edit it
Enabled, problem went away
Disabled date repeat api = *problem did not come back* <- unexpected
Enabled, still everything is normal.

So... I don't know, but something wacky is going on, and it's unsettling! :)

karens’s picture

Title: DATE + CCK » Errors after disabling date repeat if there is still repeating data in the database.

This issue needs a better title. I think this is what you're saying.

This is an edge case. If someone wants to suggest a patch of some kind I can look at it. But the fix is to re-enable the Date Repeat module, delete the dates you created, and then disable it again.

jiv_e’s picture

Issue summary: View changes
Status: Active » Closed (works as designed)

This issue is getting old with no activity. I'm cleaning the issue queue, so I'll close this. Please feel free to reopen if needed!