getting a pile of these:

Warning: htmlspecialchars() expects parameter 1 to be string, array given in check_plain() (line 1572 of E:\wamp\www\boma\includes\bootstrap.inc).

tracing it back i see that in function entity_token_token_info_alter(&$info) i see at line 156:

'name' => t('@type with delta @delta', array('@delta' => $i, '@type' => $info['types'][$token_type]['name'])),

issue is $info['types'][$token_type]['name'] is an array.. which trickles down to format_string and then htmlspecialchars (needs to be a string)

fyi.. the array is (Nodes, Workflows)

not sure best fix but issue i think is basically that we have an ambiguous token; likely needs a current() in here somewhere

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

liquidcms’s picture

Status: Active » Needs review
FileSize
918 bytes

this patch fixes this but i suspect a bigger issue at the root of this problem

Status: Needs review » Needs work

The last submitted patch, entity-ambiguous_type_token.patch, failed testing.

idflood’s picture

Here is a reroll of patch in #1. But as mentioned, I feel the root issue is somewhere else.

idflood’s picture

Status: Needs work » Needs review
kenorb’s picture

Issue summary: View changes

The same problem here.

    [4] => Array
        (
            [file] => contrib/entity/entity_token.tokens.inc
            [line] => 156
            [function] => t
            [args] => Array
                (
                    [0] => @type with delta @delta
                    [1] => Array
                        (
                            [@delta] => 0
                            [@type] => Array
                                (
                                    [0] => Products
                                    [1] => Products
                                )

                        )

                )

        )
                                    [commerce-product] => Array
                                        (
                                            [name] => Array
                                                (
                                                    [0] => Products
                                                    [1] => Products
                                                )

                                            [description] => Array
                                                (
                                                    [0] => Tokens related to individual products.
                                                    [1] => Tokens related to individual products.
                                                )

                                            [needs-data] => commerce-product
                                        )

Probably the root was just the custom patch available at: https://drupal.org/files/issues/commerce_express_checkout.tokens.inc_.patch
See: #2247295: Support for tokens
But still not sure what could be wrong with it.

kenorb’s picture

In my case this warning was causing the Migrate Exception during the migration of data (via Migrate) by stopping the records from being migrated.
Unfortunatelly I can't afford time of finding and fixing the root problem (too much debugging).
So I've tested the patch and it works correctly.

Christopher Riley’s picture

I would really like to see this patch added to the distribution. There seems to be way too many people that cannot do coding correctly and although it is not your responsibility to fix bad code in their modules this patch seems to take care of the majority of issues out there.

nerdacus’s picture

This patch (#3) does quite the warnings in dblog, but I do agree that it is a symptom of problem created somewhere else.

Chris Matthews’s picture

The 6 year old patch in #3 to entity_token.tokens.inc applied cleanly to the latest entity 7.x-1.x-dev and (if relevant) still needs review.