When trying to delete a node I receive this error:
1) Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in EntityAPIController->load() (line 219 of C:\wamp\www\ae-drupal\sites\all\modules\entity\includes\entity.controller.inc).
2) Recoverable fatal error: Object of class Message could not be converted to string in DatabaseStatementBase->execute() (line 2139 of C:\wamp\www\ae-drupal\includes\database\database.inc).
Result: the record is not deleted.
I restored previous backup and got the same error, I had not tested a node delete before. So I cannot identify a step that went wrong. The Drupal website has plenty of modules (see below).
Is there a problem between organic group and other modules, with entity ? with Entity reference prepopulate.
I really don't know.

Package Name Type Version
Administration Administration Development tools Module 7.x-3.0-rc3
(admin_devel)
Administration Administration menu (admin_menu) Module 7.x-3.0-rc3
Administration Administration menu Toolbar style Module 7.x-3.0-rc3
(admin_menu_toolbar)
Chaos tool suite Chaos tools (ctools) Module 7.x-1.2
Chaos tool suite Page manager (page_manager) Module 7.x-1.2
Chaos tool suite Views content panes (views_content) Module 7.x-1.2
Commerce Cart (commerce_cart) Module 7.x-1.4
Commerce Checkout (commerce_checkout) Module 7.x-1.4
Commerce Commerce (commerce) Module 7.x-1.4
Commerce Commerce UI (commerce_ui) Module 7.x-1.4
Commerce Customer (commerce_customer) Module 7.x-1.4
Commerce Customer UI (commerce_customer_ui) Module 7.x-1.4
Commerce Line Item (commerce_line_item) Module 7.x-1.4
Commerce Line Item UI (commerce_line_item_ui) Module 7.x-1.4
Commerce Order (commerce_order) Module 7.x-1.4
Commerce Order UI (commerce_order_ui) Module 7.x-1.4
Commerce Payment (commerce_payment) Module 7.x-1.4
Commerce Payment Method Example Module 7.x-1.4
(commerce_payment_example)
Commerce Payment UI (commerce_payment_ui) Module 7.x-1.4
Commerce Price (commerce_price) Module 7.x-1.4
Commerce Product (commerce_product) Module 7.x-1.4
Commerce Product Pricing Module 7.x-1.4
(commerce_product_pricing)
Commerce Product Pricing UI Module 7.x-1.4
(commerce_product_pricing_ui)
Commerce Product Reference Module 7.x-1.4
(commerce_product_reference)
Commerce Product UI (commerce_product_ui) Module 7.x-1.4
Commerce Tax (commerce_tax) Module 7.x-1.4
Commerce Tax UI (commerce_tax_ui) Module 7.x-1.4
Commerce (contrib) Commerce Custom Line Items Module 7.x-1.x-dev
(commerce_custom_line_items)
Commerce (contrib) Commerce VBO Views (commerce_vbo_views) Module 7.x-1.2
Commerce (PayPal) PayPal (commerce_paypal) Module 7.x-1.0
Commerce (PayPal) PayPal WPP (commerce_paypal_wpp) Module 7.x-1.0
Commerce (PayPal) PayPal WPS (commerce_paypal_wps) Module 7.x-1.0
Contact Forms Contact Forms (contact_forms) Module 7.x-1.6
Context Context (context) Module 7.x-3.0-beta
6
Context Context UI (context_ui) Module 7.x-3.0-beta
6
Core Block (block) Module 7.19
Core Color (color) Module 7.19
Core Comment (comment) Module 7.19
Core Contact (contact) Module 7.19
Core Content translation (translation) Module 7.19
Core Contextual links (contextual) Module 7.19
Core Dashboard (dashboard) Module 7.19
Core Database logging (dblog) Module 7.19
Core Field (field) Module 7.19
Core Field SQL storage (field_sql_storage) Module 7.19
Core Field UI (field_ui) Module 7.19
Core File (file) Module 7.19
Core Filter (filter) Module 7.19
Core Forum (forum) Module 7.19
Core Help (help) Module 7.19
Core Image (image) Module 7.19
Core List (list) Module 7.19
Core Locale (locale) Module 7.19
Core Menu (menu) Module 7.19
Core Node (node) Module 7.19
Core Number (number) Module 7.19
Core Options (options) Module 7.19
Core Path (path) Module 7.19
Core RDF (rdf) Module 7.19
Core Search (search) Module 7.19
Core Shortcut (shortcut) Module 7.19
Core System (system) Module 7.19
Core Taxonomy (taxonomy) Module 7.19
Core Text (text) Module 7.19
Core Update manager (update) Module 7.19
Core User (user) Module 7.19
Date/Time Calendar (calendar) Module 7.x-3.4
Date/Time Date (date) Module 7.x-2.6
Date/Time Date All Day (date_all_day) Module 7.x-2.6
Date/Time Date API (date_api) Module 7.x-2.6
Date/Time Date Popup (date_popup) Module 7.x-2.6
Date/Time Date Views (date_views) Module 7.x-2.6
Development Devel (devel) Module 7.x-1.3
Development Drupal for Firebug (drupalforfirebug) Module 7.x-1.4
Development Drupal for Firebug Preprocessor Module 7.x-1.4
(drupalforfirebug_preprocess)
Example modules Countries Example (countries_example) Module 7.x-2.1
Features Events calendar feature Module 7.x-1.0
(events_calendar_feature)
Features Features (features) Module 7.x-1.0
Features extra FE block (fe_block) Module 7.x-1.0-alph
a1
Features extra FE nodequeue (fe_nodequeue) Module 7.x-1.0-alph
a1
Features extra FE profile (fe_profile) Module 7.x-1.0-alph
a1
Fields Address Field (addressfield) Module 7.x-1.0-beta
3
Fields Countries (countries) Module 7.x-2.1
Fields Countries configuration Module 7.x-2.1
(countries_configuration)
Fields Email (email) Module 7.x-1.2
Fields Entity Reference (entityreference) Module 7.x-1.0
Fields Link (link) Module 7.x-1.0
Media IMCE (imce) Module 7.x-1.6
Message Message (message) Module 7.x-1.7
Message Message example (message_example) Module 7.x-1.7
Message Message notify (message_notify) Module 7.x-2.3
Multilingual Localization update (l10n_update) Module 7.x-1.0-beta
3
Multilingual - Internationalization Block languages (i18n_block) Module 7.x-1.8
Multilingual - Internationalization Contact translation (i18n_contact) Module 7.x-1.8
Multilingual - Internationalization Countries translation (countries_i18n) Module 7.x-2.1
Multilingual - Internationalization Field translation (i18n_field) Module 7.x-1.8
Multilingual - Internationalization Internationalization (i18n) Module 7.x-1.8
Multilingual - Internationalization Language icons (languageicons) Module 7.x-1.0
Multilingual - Internationalization Menu translation (i18n_menu) Module 7.x-1.8
Multilingual - Internationalization Multilingual content (i18n_node) Module 7.x-1.8
Multilingual - Internationalization Multilingual forum (i18n_forum) Module 7.x-1.8
Multilingual - Internationalization Multilingual select (i18n_select) Module 7.x-1.8
Multilingual - Internationalization Path translation (i18n_path) Module 7.x-1.8
Multilingual - Internationalization Profile2 translation (profile2_i18n) Module 7.x-1.3
Multilingual - Internationalization Rules translation (rules_i18n) Module 7.x-2.2
Multilingual - Internationalization String translation (i18n_string) Module 7.x-1.8
Multilingual - Internationalization Synchronize translations (i18n_sync) Module 7.x-1.8
Multilingual - Internationalization Taxonomy translation (i18n_taxonomy) Module 7.x-1.8
Multilingual - Internationalization Translation redirect (i18n_redirect) Module 7.x-1.8
Multilingual - Internationalization Translation sets (i18n_translation) Module 7.x-1.8
Multilingual - Internationalization Variable translation (i18n_variable) Module 7.x-1.8
Multilingual - Internationalization Views translation (i18nviews) Module 7.x-3.x-dev
Node export Node export (node_export) Module 7.x-3.0
Nodequeue Nodequeue (nodequeue) Module 7.x-2.0-beta
1
Nodequeue Nodequeue Service (nodequeue_service) Module 7.x-2.0-beta
1
Organic groups Organic groups (og) Module 7.x-2.0-rc2
Organic groups Organic groups access control Module 7.x-2.0-rc2
(og_access)
Organic groups Organic groups context (og_context) Module 7.x-2.0-rc2
Organic groups Organic groups field access Module 7.x-2.0-rc2
(og_field_access)
Organic groups Organic groups register (og_register) Module 7.x-2.0-rc2
Organic groups Organic groups UI (og_ui) Module 7.x-2.0-rc2
Organic groups Profile2 group access Module 7.x-1.3
(profile2_og_access)
Other Advanced help (advanced_help) Module 7.x-1.0
Other Boxes (boxes) Module 7.x-1.0
Other Colorbox (colorbox) Module 7.x-1.4
Other Entity API (entity) Module 7.x-1.0+0-de
v
Other Entity tokens (entity_token) Module 7.x-1.0+0-de
v
Other Insert (insert) Module 7.x-1.2
Other Masquerade (masquerade) Module 7.x-1.0-rc5
Other Module filter (module_filter) Module 7.x-1.7
Other Pathauto (pathauto) Module 7.x-1.2
Other Paypal Donation Page (paypal_donate) Module 7.x-1.6
Other Profile2 (profile2) Module 7.x-1.3
Other Profile2 pages (profile2_page) Module 7.x-1.3
Other Select (or other) (select_or_other) Module 7.x-2.15
Other String Overrides (stringoverrides) Module 7.x-1.8
Other Strongarm (strongarm) Module 7.x-2.0
Other Token (token) Module 7.x-1.4
Panels Panels (panels) Module 7.x-3.3
Rules Rules (rules) Module 7.x-2.2
Rules Rules UI (rules_admin) Module 7.x-2.2
Services Services (services) Module 7.x-3.3
Taxonomy TagClouds (tagclouds) Module 7.x-1.7
Translation Management Translation Management Core (tmgmt) Module 7.x-1.0-alph
a2
Translation Management Translation Management Field Module 7.x-1.0-alph
(tmgmt_field) a2
User interface IMCE Wysiwyg API bridge (imce_wysiwyg) Module 7.x-1.0
User interface Wysiwyg (wysiwyg) Module 7.x-2.2
UUID Universally Unique ID (uuid) Module 7.x-1.0-alph
a3+51-dev
Variable Variable (variable) Module 7.x-2.2
Variable Variable realm (variable_realm) Module 7.x-2.2
Variable Variable store (variable_store) Module 7.x-2.2
Views Views (views) Module 7.x-3.5
Views Views Bulk Operations Module 7.x-3.1
(views_bulk_operations)
Views Views UI (views_ui) Module 7.x-3.5
Core Bartik (bartik) Theme 7.19
Core Seven (seven) Theme 7.19
Other Perspective (perspective) Theme
Other Rubik (rubik) Theme 7.x-4.0-beta
8

CommentFileSizeAuthor
#5 entity-delete_node_warning-1893312-5.patch861 bytesheilop
error-node-delete.png19.52 KBAnonymous (not verified)
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zero4281’s picture

I was working with a custom entity and got the same error when I called entity_delete(). I looked through the controller class load function and found the array_flip. Then I looked through entity_delete, and entity_delete_multiple and decided to try using:

entity_delete_multiple('entity_table', array($entity_id => $entity_id));

That fixed the warning and the 500 error. If entity_delete called entity_delete_multiple this way then these errors wouldn't happen anymore, but I'm not sure if that's the correct approach to entities.

zero4281’s picture

Upon further inspection I believe that the array_flip on line 219 of entity.controller.inc could be eliminated if line 226:

$ids = array_keys(array_diff_key($passed_ids, $entities));

changed to:

$ids = array_diff($passed_ids, array_keys($entities));

Pepper’s picture

I'm getting this error as well, simply when creating a new draft (workbench) with entity 7.x-1.6. Is there a patch at this point? Or just post #2?

NancyDru’s picture

I did pretty much the same as #1 and the problem went away.

heilop’s picture

I had the same error than @Pepper (comment #3). When creating or editing an entity what it had a paragraph entity type, I got that error.
I created a little patch to avoid this warning.

heilop’s picture

Status: Active » Needs review
hgoto’s picture

Chris Matthews’s picture

Version: 7.x-1.0-rc3 » 7.x-1.x-dev

The 2 year old patch in #5 to entity.controller.inc applied cleanly to the latest entity 7.x-1.x-dev and (if still relevant) needs review.