I get the following errors when trying to create an entityforms entity using the rules action 'Create a new entity'.
Steps to reproduce:
- fresh drupal install (7.28-dev) with entity API (1.5), entityform 2.0-beta3, rules 2.7
- create a rule with the "Create a new entity" action and make sure it gets triggered (example attached, trigger it by updating a user account)
- The entityform form is not created and you should see these errors:
Warning: Illegal offset type in isset or empty in entityform_get_types() (line 383 of .../sites/all/modules/entityform/entityform.module).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in EntityAPIControllerExportable->load() (line 742 of .../sites/all/modules/entity/includes/entity.controller.inc).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in EntityAPIControllerExportable->cacheGetByName() (line 787 of .../sites/all/modules/entity/includes/entity.controller.inc).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in EntityAPIController->load() (line 219 of .../sites/all/modules/entity/includes/entity.controller.inc).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in EntityAPIControllerExportable->cacheGet() (line 773 of .../sites/all/modules/entity/includes/entity.controller.inc).
Recoverable fatal error: Object of class EntityformType could not be converted to string in DatabaseStatementBase->execute() (line 2168 of .../includes/database/database.inc).
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | entityform-handle_object_for_type-2260021-2.patch | 867 bytes | tedbow |
| rule.create.entity.txt | 545 bytes | firfin |
Comments
Comment #1
firfin commentedComment #2
tedbowOk see the problem.
In EntityformController->create()
I was expecting a string but Rules is sending an EntityformType object.
This patch converts that to a string. Not sure if this is the best way to solve it.
Please test.
Comment #3
firfin commentedPatch from #2 solves the problem for me. No more errors and the entities get created correctly. Thanks @tedbow
Comment #4
tedbowThanks for reporting back. Committed