This red bar notification appears when these conditions are met:

1. Users choose to show a menu link for the article
2. Users input more than 1 tag.
3. There are at least 1 Thai word (คำไทย) in those tags

Not sure this notification would also appear in other languages. I'd be nice to check.

 Array to string conversion in DrupalDefaultEntityController->cacheGet()

CommentFileSizeAuthor
thai-language-issue.jpg83.7 KBweeix
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Anonymous’s picture

Category: bug » support
Status: Active » Postponed (maintainer needs more info)

What does your line 368 of includes/entity.inc say? I don't see how an array could become a string with PHP function array_diff_assoc().

file include/entity.inc @line 368

        if (array_diff_assoc($conditions, $entity_values)) {

Both $conditions and $entity_values are an array.
Maybe you need to turn off the Notices from PHP in php.ini or your settings.php file. This is recommended practice for a production system.

http://www.php.net/manual/en/errorfunc.configuration.php#ini.error-repor...
http://php.net/manual/en/function.error-reporting.php

weeix’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

Thanks earnie. I'll turn notices off as you suggest.

btw, after reading this issue in php.net:
https://bugs.php.net/bug.php?id=62115

I found this message by maarten:

The array_diff* methods aren't recursive. So you probably won't want to use them for multidimensional arrays, and thus it's an improvement that >= 5.4.0 warns you.

$entity_values is a multidimensional array, so it make sense if I'm noticed

but what I still wonder is when we cut the tags to 1 or none, PHP stop notifying me although the $entity_values doesn't change at all.

Anonymous’s picture

Title: Notice: Array to string conversion in DrupalDefaultEntityController->cacheGet() » PHP array_diff* API isn't recommended for multidimensional arrays
Version: 7.16 » 8.x-dev
Component: entity system » other
Category: support » bug
Status: Closed (won't fix) » Active

Yea, php 5.4 isn't recommended for Drupal as yet.

Making a bug report for consideration of potential fixes.

pfrenssen’s picture