I have created entities with eck. Each contains a field collection with a date popup inside. For some reason, the popup does not work and I get the following errors:

"Warning: in_array() expects parameter 2 to be array, null given in DateObject->limitGranularity() (line 503 of /srv/http/rotamanager/sites/all/modules/date/date_api/date_api.module)"

I then put a field collection containing a date field in the user registration form, and it works fine with no errors. So it would seem that both Date and Field Collection are working as they should, just not with eck.

Seems to be similar to [#6405874]

I get the same problem if I use 7.x-2.0-beta1+20-dev.
And the same again if I use a date field without a field collection.

Drupal Core version minimal-7.15.

Anyone else having this problem?

Comments

mdlopresti’s picture

I am I also posted on the date module issue , as I think it's an issue with the date module not interacting with the entity API properly.

leschekfm’s picture

Just for reference I'm linking the issue in the date queue #1480846: Calling node_form with date fields in custom module causes error

leschekfm’s picture

Priority: Normal » Major
Status: Active » Needs review
StatusFileSize
new751 bytes

I did some debugging and noticed that eck__entity__form() doesn't allow the form_state to be altered. The attached patch fixes this. Please review

leschekfm’s picture

Version: 7.x-2.0-beta1 » 7.x-2.x-dev
Component: User interface » Code
pedrorocha’s picture

Status: Needs review » Reviewed & tested by the community

I was affected by some strange error when trying to save a ECK entity type, with a Field Collection field, breaking everything and giving a Drupal error page. Looking a while, i suspected that it wasn't a Date field or Field Collection problem, but ECK itself. With this patch, everything seems to be ok now, and as $form_state is mean to be used in a way that it could be updated, i think it's a good patch to be commited.

Anonymous’s picture

work for me :-)

thirdender’s picture

acrazyanimal’s picture

Status: Reviewed & tested by the community » Fixed

Thanks for the patch. committed

Status: Fixed » Closed (fixed)

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

klonos’s picture

savithac’s picture

#3 works for me.thank you.

  • Commit bd37da2 on 7.x-2.x, change_paths, own_permissions, 7.x-2.x-property-widgets, 7.x-3.x, entity_reference, 7.x-3.x-settings, 7.x-2.0.x, 7.x-2.1.x authored by leschekfm, committed by acrazyanimal:
    issue #1780382 by leschekfm, Chi: Added missing...

  • Commit bd37da2 on 7.x-2.x, change_paths, own_permissions, 7.x-2.x-property-widgets, 7.x-3.x, entity_reference, 7.x-3.x-settings, 7.x-2.0.x, 7.x-2.1.x authored by leschekfm, committed by acrazyanimal:
    issue #1780382 by leschekfm, Chi: Added missing...

  • Commit bd37da2 on 7.x-2.x, 7.x-3.x, 8.x authored by leschekfm, committed by acrazyanimal:
    issue #1780382 by leschekfm, Chi: Added missing...

  • Commit bd37da2 on 7.x-2.x, 7.x-3.x, 8.x authored by leschekfm, committed by acrazyanimal:
    issue #1780382 by leschekfm, Chi: Added missing...