Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I updated to the dev version of Entity API, and now on one of my two sites when I clear the cache I get:
Notice: Array to string conversion in EntityAPIControllerExportable->applyConditions() (line 625 of /etc/drupal/7/sites/all/modules/entity/includes/entity.controller.inc).
Comment | File | Size | Author |
---|---|---|---|
#20 | 1514764-fix_entity_conditions-20.patch | 1.11 KB | amateescu |
#18 | 1514764-fix_entity_conditions.patch | 1.03 KB | amateescu |
#15 | entity-array_diff_assoc-1514764-15.patch | 743 bytes | yuriy.babenko |
#11 | entity module fail on 624.PNG | 57.75 KB | shaiss |
#10 | Screenshot from 2012-05-18 22:16:10.png | 55.97 KB | rogical |
Comments
Comment #1
paulcheck CreditAttribution: paulcheck commentedHas anyone else had this problem? For some reason it only appears on one of two sites, despite sharing much of the modules, etc, in common.
Comment #2
alexweber CreditAttribution: alexweber commentedCan't replicate this at all, I've been using the dev version all weekend.
What modules are you using that require Entity API?
Comment #3
lEaDbEllY CreditAttribution: lEaDbEllY commentedI'm getting this too. Its not really stopping much, just annoying (AFAICT). I have a big gob of modules available (I load modules automatically so they all get installed the same way).
The ones requiring Entity API are:
Date iCal
OG example
Entity Reference
Entity Reference Behavior Example
Rules translation (is available in modules but not installed --no check mark)
Organic groups
Organic groups access control
Organic groups context
Organic groups field access
Organic groups migrate (is available in modules but not installed --no check mark)
Organic groups register
Organic groups UI
Profile2 group access
Entity API
Entity tokens
Profile2
Profile2 pages
Rules
Rules Scheduler
Rules UI
Views Bulk Operations
Workflow rules
... the large number may make it a bear to chase down exactly *where* something is breaking. The needle is small and the haystack very large. Its a bit of a test site. I have 56 modules available (not all are installled). I only listed the modules that use Entity API. I'm running drupal-7.12, and php-5.4.0.
Thanks
Comment #4
paulcheck CreditAttribution: paulcheck commentedSry for the delay. The modules that require Entity that I have installed and enabled are:
Entity tokens (enabled), Rules (enabled), Commerce (enabled), Commerce UI (enabled), Customer (enabled), Price (enabled), Line Item (enabled), Order (enabled), Payment (enabled), Authorize.Net (enabled), Checkout (enabled), Product (enabled), Product Reference (enabled), Rules UI (enabled), Product Pricing (enabled), Cart (enabled), Commerce Checkout Progress (enabled), Customer UI (enabled), Commerce File (enabled), Line Item UI (enabled), Commerce Multicurrency (enabled), No Payment Payment Method (enabled), Order UI (enabled), Payment Method Example (enabled), Payment UI (enabled), Physical Product (enabled), Product Pricing UI (enabled), Product UI (enabled), Shipping (enabled), Shipping Method Example (enabled), Flat Rate (enabled), Shipping UI (enabled), Tax (enabled), Tax UI (enabled), UPS (enabled), Rules translation (enabled), Rules Scheduler (enabled)
Given that I have two sites and one of them doesn't have Commerce or Shipping enabled and also doesn't show the error, perhaps it is one of those groups. I could try to selectively enable the modules that are missing on the second site and see if I can trigger it, or conversely disable those modules on the site where the error is occuring (probably a better strategy).
The error occurs so far only when I clear the cache. -P
Comment #5
paulcheck CreditAttribution: paulcheck commentedThis might not directly help, but I disabled a number of modules in the various commerce sections and was able to get rid of the error. Note that depending on which modules I have installed I get different numbers of the same error. Anyway, here is the list of modules that depend on Entity API, that I disabled in order to have no errors when I clear the cache:
Required by: Payment (disabled), Authorize.Net (disabled), Checkout (disabled), Cart (disabled), Commerce Checkout Progress (disabled), Line Item UI (disabled), No Payment Payment Method (disabled), Order UI (disabled), Payment Method Example (disabled), Payment UI (disabled), Physical Product (disabled), Product Pricing UI (disabled), Shipping (disabled), Shipping Method Example (disabled), Flat Rate (disabled), Shipping UI (disabled), Tax UI (disabled), UPS (disabled)
Hope this helps?
Comment #6
alexweber CreditAttribution: alexweber commentedThis seems like a clear case of one or more of those modules relying specifically on an older version of Entity API.
There have been some changes in recent versions of Entity API that could potentially break things if other modules don't follow suit and update themselves (or specify what specific version of Entity API is required for them).
Comment #7
paulcheck CreditAttribution: paulcheck commentedDo you say it's clear because the problem goes away when I delete those modules? Is it possible that entity has an error that's getting triggered by those modules? After all, the error is happening in an entity routine. Any idea on what change in this case is causing the error?
Comment #8
raveendrab CreditAttribution: raveendrab commentedProblem exists with core 7.14. Every time I try to clear cache, the error dsiplayed. I am using rooms, commerce modules which depends on entity api. This is clean installation with out any content.
Comment #9
kotnik CreditAttribution: kotnik commentedI am having this issue with PHP 5.4.3, but not with 5.3.13.
As people migrate to PHP 5.4, we will see more and more issues like this.
Comment #10
rogical CreditAttribution: rogical commentedComment #11
shaiss CreditAttribution: shaiss commentedsame happens to me on flush caches but on line 624 after updating entity to rc3 and rules 2.1
Same thing happens on rc2
Comment #12
shaiss CreditAttribution: shaiss commentedI had the same issue. I moved my site to my dev host running php 5.3.1 and issue went away.
A similar issue is happening with the rules module: http://drupal.org/node/1463678#comment-6069000
Comment #13
paulcheck CreditAttribution: paulcheck commentedFresh update to commerce and I'm still getting the error. Are the commerce people aware? It sounds like a problem with commerce, not entity.
Comment #14
kotnik CreditAttribution: kotnik commentedPaulcheck, this *is* Entity API issue with PHP 5.4 and there's nothing commerce module can do to solve it. It happens with other modules that rely on Entity API.
Downgrade to PHP 5.3 if you want to avoid this, and wait for Entity API fix for the issue.
Comment #15
yuriy.babenko CreditAttribution: yuriy.babenko commentedRan into this issue after updating to PHP 5.4.3 earlier today, and am attaching a patch.
Note: this solves the notice in my environment and at quick glance appears to be the same functionality as provided by
array_diff_assoc()
(as far as Entity's use case goes), but I didn't do any extensive testing and this patch definitely needs a review by someone more familiar with Entity's internals.Comment #16
rogical CreditAttribution: rogical commentedIt works!
Comment #17
deepbluesolutions CreditAttribution: deepbluesolutions commentedworks for me too, well the error has gone, and seeing no side effects at the moment.
there are similar errors all over, for 5.4 PHP users, http://drupal.org/node/1511396
for example:
Notice: Array to string conversion in views_plugin_cache->gather_headers() (line 196 of /var/www/html/sites/all/modules/views/plugins/views_plugin_cache.inc).
having been trying to see if a similar approach works with the code in views_plugin_cache, but not much joy at the moment, will update when I have more.
your code
if ($conditions) {
foreach ($entities as $key => $entity) {
$entity_values = (array) $entity;
+
+ foreach ($conditions as $c_key => $c_value) {
+ if (!isset($entity_values[$c_key]) || serialize($c_value) != serialize($entity_values[$c_key])) {
+ unset($entities[$key]);
+ break;
+ }
views code
$this->storage['css'] = array_diff_assoc($css, $css_start);
Comment #18
amateescu CreditAttribution: amateescu commentedI think the correct patch should be something like this. Also see http://drupal.org/node/1525176#comment-6317632.
Comment #19
fagoLet's just do a single if with an OR here?
Comment #20
amateescu CreditAttribution: amateescu commentedSure, with a comment too :)
Comment #21
ParisLiakos CreditAttribution: ParisLiakos commentedthanks, that was pretty annoying error
Comment #22
fagoOh, sry for getting this one. Committed and pushed.
Comment #23
kewigro CreditAttribution: kewigro commentedI'm not clear on how to fix this error. Do I need to insert the code from the patch somewhere? Where would I put it? I'm new to drupal and php. Any help would be appreciated.
Comment #24
szt CreditAttribution: szt commented@kewigro: as #22 said the issue solved, and comitted: use the latest 7.x-1.x-dev version
Comment #25
mgriebe CreditAttribution: mgriebe commented@kewigro: You need to either 1) apply the patch or 2) update to the dev version of the module. Check out http://drupal.org/patch/apply. You can apply it "by hand" by reading the patch and seeing what it does and where it does it.
Consider the patch...
The path of the patch is written relative to the module root. In this case, the module root is "sites/all/modules/entity". The patch will write to "sites/all/modules/entity/includes/entity.controller.inc". The minuses are lines that will be deleted. The pluses are lines that are added. The lines with neither minuses nor pluses are there for context must be matched in the file or the patching process will throw errors or "ignore hunks." The @@ is a summary that tells you, in this case, that the subtractions start at line 621, as do the additions. Each hunk has it own @@ summary. That's pretty much it.
Comment #27
redshield CreditAttribution: redshield commentedI was having the same issue and managed to get rid of this notices by disabling the following modules:
Messages Example
Messages OG Examples
OG Examples
Comment #28
joachim CreditAttribution: joachim commentedCould this fix maybe warrant a new RC release please?
Comment #29
Ilikejava CreditAttribution: Ilikejava commentedI had this problem that was causing safe_value to miss-behave with a number of fields of nodes on my site. When I updated ['value'], it was storing the new data in ['safe_value']. I had a suspension that the error associate with the entity module had something to do with it. Sure enough, I installed the patch in #20. The error message went away and now my data is behaving.
Thanks for all the efforts.
Comment #30
waqarit CreditAttribution: waqarit commented#15 worked for me. thanks