array_flip() warning in EntityListWrapper->label() on line 1086 of entity.wrapper.inc

Created on 11 November 2013, about 11 years ago
Updated 9 February 2023, almost 2 years ago

Hi there,

I have a rule which checks to see if the value of a checkbox (that is, a Boolean field) has changed from false to true. As an action, the rule emails out both the old value and the new. Immediately after saving the content when this rule is active, I get the following warning, repeated twice:

Warning: array_flip(): Can only flip STRING and INTEGER values! in EntityListWrapper->label() (line 1086 of ... contrib/entity/includes/entity.wrapper.inc).

When this happens, the value of parent::value() is:

array(
  0 => true,
);

This only happens when you try to include either the old ([node-unchanged:field-xxxxx]) or new ([node:field-xxxxx]) values in an action (send an email, display a message, etc.)

I tried this on other field types and, so far, it only happens on Booleans.

The attached patch fixes the problem, but might not be the best approach - I'm not sure what side effects it might have.

Note that this is not the same as #1102570: array_flip() [function.array-flip] issue in DrupalDefaultEntityController / entity.inc β†’ , though it may be related.

πŸ› Bug report
Status

Needs review

Version

1.0

Component

Code - misc

Created by

πŸ‡ΊπŸ‡ΈUnited States venutip

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024