Drupal 7.22 PHP 5.4

warning on preview new event. white screen on save. event not saved.

Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityCacheControllerHelper::entityCacheLoad() (line 64 of /var/www/drupal-commons/profiles/commons/modules/contrib/entitycache/entitycache.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityCacheControllerHelper::entityCacheLoad() (line 64 of /var/www/drupal-commons/profiles/commons/modules/contrib/entitycache/entitycache.module).
Notice: String offset cast occured in _field_invoke_multiple() (line 322 of /var/www/drupal-commons/modules/field/field.attach.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityCacheControllerHelper::entityCacheLoad() (line 64 of /var/www/drupal-commons/profiles/commons/modules/contrib/entitycache/entitycache.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityCacheControllerHelper::entityCacheLoad() (line 64 of /var/www/drupal-commons/profiles/commons/modules/contrib/entitycache/entitycache.module).
Notice: String offset cast occured in _field_invoke_multiple() (line 322 of /var/www/drupal-commons/modules/field/field.attach.inc).

Comments

stupiddingo’s picture

Version: » 7.x-3.2

I can confirm this behaviour for events when hitting preview on Commons 3.2 and latest 3.x from build-commons-dev.make

Commons 3.2
Clicking preview displays errors reported above. Clicking submit whitescreens with error:

Fatal error: Cannot create references to/from string offsets nor overloaded objects in /commons32/includes/common.inc on line 6548

Commons 3.3x
First time preview button is clicked the edit page reloads with no error. On second click preview page loads with errors:

Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityCacheControllerHelper::entityCacheLoad() (line 64 of /commons3x/profiles/commons/modules/contrib/entitycache/entitycache.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /commons3x/includes/entity.inc).
Notice: String offset cast occurred in _field_invoke_multiple() (line 321 of /commons3x/modules/field/field.attach.inc).
Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityCacheControllerHelper::entityCacheLoad() (line 64 of /commons3x/profiles/commons/modules/contrib/entitycache/entitycache.module).
Warning: array_flip(): Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 355 of /commons3x/includes/entity.inc).
Notice: String offset cast occurred in _field_invoke_multiple() (line 321 of /commons3x/modules/field/field.attach.inc).

Interestingly, in both 3.2 and 3.3x submitting without previewing works with no errors.

My hunch is either dates or address based on this behaviour being absent for all other content types. I'll try to track this down.

jpontani’s picture

Assigned: Unassigned » jpontani

I'll investigate more, but for starters, Commons does not officially support PHP 5.4 or higher just yet. While many aspects may work, there is the potential that some do not. As such, PHP 5.3 is the recommended environment for production use.

ezra-g’s picture

Title: warning after previewing new event. » Warning after previewing new event with php 5.4
japerry’s picture

Title: Warning after previewing new event with php 5.4 » Warning after previewing new event.
StatusFileSize
new198.79 KB

Same issue occurs on php 5.3.27. Just tested on 3.4 and dev, still persists.

thinkdrupal’s picture

Same issue with PHP 5.3.17....using commons 7.x-3.5 and Drupal 7.24. When you click preview (this time for creating an Event), you get the error. However, I was able to save the Event with no errors.

lsolesen’s picture

Version: 7.x-3.2 » 7.x-3.13
Issue summary: View changes

Still present in newest version of Commons.

japerry’s picture

Version: 7.x-3.13 » 7.x-3.x-dev
Status: Active » Needs review
StatusFileSize
new747 bytes

Registration is trying to load but the event doesn't exist yet. We shouldn't be doing this.... Here is a patch!

devin carlson’s picture

Assigned: jpontani » Unassigned
Status: Needs review » Fixed

Tested #7 with an existing Commons site and confirmed that it fixed the issue.

The fact that a registration is being created in a theme function and attached to an entity's build array as raw HTML should be refactored but I'll tackle that in a separate issue.

Committed #7 to Commons 7.x-3.x.

  • Commit 78da10a on 7.x-3.x authored by japerry, committed by Devin Carlson:
    Issue #1991320 by japerry: Fixed error messages displayed while...

Status: Fixed » Closed (fixed)

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