PHP version: 5.2.5, Drupal 6.4

I'm not sure if this lands in CCK proper or in Date. I've got the latest (6.x-2.x-dev) version of Date (including reinstalling it twice), which I upgraded to because I was seeing this error:

Fatal error: Cannot unset string offsets in C:\wamp\www\drupal-6.2\sites\all\modules\date\date\date_elements.inc on line 280.

In attempting to file this bug report, I enabled content copy in order to export the field, and went to the Content type -> field and hit Configure that's when I got this error that points at CCK:

Fatal error: Cannot unset string offsets in C:\wamp\www\drupal-6.2\sites\all\modules\cck\includes\content.node_form.inc on line 57

So now I can't edit the field. Doh. It's a pretty simple field, using Datetime as the type and one of the default formats for dates. This field did work before, but since the last time I looked at it, I've upgraded to D6.4, Date, and CCK, so I don't know for sure if I've messed something up, or if it's not me, which of the 3 upgrades might be the root cause. I'm more inclined to think it's CCK as it's line 57 is an unset: unset($items[$field['field_name'] .'_add_more']);

I feel like this isn't very helpful information-wise - I've marked it critical because I can not edit the field, nor can I use the content type with the date field defined. I can edit other created fields without a problem. Even stranger, I created a new Date field using datetime as the type and it's working normally.

Comments

karens’s picture

Project: Content Construction Kit (CCK) » Date
Version: 6.x-2.0-rc6 » 6.x-2.x-dev
Component: content.module » Code

This is a Date problem, but it might be related to #283985: Content copy destroys field settings, which I am working on now.

karens’s picture

Status: Active » Postponed (maintainer needs more info)

I can't replicate the problem, so I'm not sure what to do. There was definitely a problem with Content Copy, and fixes have been committed for that. But if you were seeing a problem originally that was unrelated to Content Copy, I'm not sure what happened.

It definitely sounds like your date settings got corrupted somehow, and using Content Copy was doing that before it got fixed.

Do you have data you will lose if that date field isn't fixed? If so, let me know and I'll try to help you un-corrupt it, otherwise I would just delete it and start over.

karens’s picture

Status: Postponed (maintainer needs more info) » Fixed

There are new releases of Date, Calendar, Views, and CCK and you need all of them. See if you still have a problem with the latest code.

Since there was no response to the previous message in several weeks, marking it fixed unless you find it is still a problem in latest version.

Anonymous’s picture

Status: Fixed » Closed (fixed)

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

TxAvA’s picture

Status: Closed (fixed) » Active

Arrrgh!, Same problem with latest dev versions (cck included):

When I try to edit Date field:
Fatal error: Cannot unset string offsets in modules/cck/includes/content.node_form.inc on line 77
If I comment these line 77, I get:
Fatal error: Cannot use string offset as an array in modules/date/date/date_elements.inc on line 150

And I can't create new content from content types if they got Date field! (Blank page)

TxAvA’s picture

Status: Active » Closed (fixed)

Uf, solved. I forgot to enable Date Pop-up

webdevbyjoss’s picture

Hi, I have the same problem while calling


  $form = drupal_get_form('mycontentype_node_form');
 

my content type created with cck using couple additional text fields.