I have a date field and other fields within a multigroup (via cck 3.x).

The multigroup has fields like: date, user list, select lists, etc, so I am trying to hide parts of the group when the user logged in is different for what the user list is showing.

My code for hiding fields is based on: http://drupal.org/node/357328#comment-2259304

It works well with all the other fields, except the date field.

When I use it to remove a date field within a multigroup, it removes/hides the field. However, when a user now tries and saves changes I get "The dates are invalid" error on the date field. Not sure why, but it looks like it discards original data in the date field, when it should not be doing so

Hence this looks like a date field bug when in multigroup.

Please do you have any suggestions on how to get around this?

I also tried the read-only alternative code published in the thread http://drupal.org/node/357328. That
works only on text fields, and does not work on : date, user list, select lists...

Thanks for your help

Comments

zeezhao’s picture

A bit more information - the code uses:

$elements['#access'] = FALSE;

So issue may also be related to this one: http://drupal.org/node/749874

zeezhao’s picture

Status: Active » Closed (fixed)
tazir1’s picture

Version: 6.x-2.4 » 7.x-2.0-alpha5
Priority: Normal » Major
Status: Closed (fixed) » Active

Getting similar problem:
Having date field under user profile (using profile2 - http://drupal.org/project/profile2)
After hiding date field, cannot register: There are errors in [field_name] value #1:
The dates are invalid.

karens’s picture

Version: 7.x-2.0-alpha5 » 6.x-2.4
Priority: Major » Normal
Status: Active » Closed (fixed)

Please do not re-open D6 issues and switch versions. The code in D6 and D7 is totally different. The bugs are not the same. The issues are not the same. Even if they have the same outcome, they are different issues.