Closed (fixed)
Project:
Page Title
Version:
7.x-2.x-dev
Component:
Miscellaneous
Priority:
Major
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
29 Mar 2011 at 10:08 UTC
Updated:
27 Jun 2011 at 08:57 UTC
Jump to comment: Most recent file
Comments
Comment #1
catchThis happens if something other than an array of IDs gets passed to entity_load(), and it's the same error for core as entitycache, and is usually down to bad data.
Could you put file_put_contents('/tmp/backtrace.txt', print_r(debug_backtrace()), FILE_APPEND); just above line 54, hit that page, then upload that file to this issue?
Also are you using any modules other than core?
Comment #2
eule commentedhi
jep some other modules: agrcache,entity
please correct me if i wrong
$passed_ids = !empty($ids) ? array_flip($ids) : FALSE;
('/tmp/backtrace.txt', print_r(debug_backtrace()), FILE_APPEND);
sorry i don´t have programming knowledge:
Parse error: syntax error, unexpected ',' in ./sites/all/modules/entitycache/entitycache.module on line 55
EDIT:
and english as well..i put it now above but same
Parse error: syntax error, unexpected ',' in ./modules/entitycache/entitycache.module on line 54
Comment #3
eule commentedsorry sorry i´m so stupid
i put this now above file_put_contents('/tmp/backtrace.txt', print_r(debug_backtrace()), FILE_APPEND);
its prints a huge txt on the site but can´t find /tmp/backtrace.txt is this for the root or module folder?
anyway i paste and save it
Comment #4
tebb commented@catch
I'm getting the same (line 53 not 54?) warning, but it feels random so far.
I'm switching between https and http a bit in case that is relevant.
Will put the trace file statement in and upload if I catch it again.
@eule:
The trace file should be in the /tmp directory.
If you have a command line, you should be able to do this:
cd /tmp
ls -l backtrace.txt
cat backtrace.txt
The last command will list the file to your screen.
(Sorry if you already know all this.)
Comment #5
tebb commentedHad a similar issue, so will add the backtrace to line 177 in entity.inc, with a different file name.
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /pathToD7/includes/entity.inc).
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->cacheGet() (line 354 of /pathToD7/includes/entity.inc).
Comment #6
tebb commentedPossibly a newbie error on my part, but I can't see the cause.
I'm getting the backtrace output to the screen and only a line of 1's in the file.
The only difference between my code and the suggestion in #1 is the filename.
file_put_contents('/tmp/backtrace.txt', print_r(debug_backtrace()), FILE_APPEND);
file_put_contents('/tmp/backtrace.entitycache.module.txt', print_r(debug_backtrace()), FILE_APPEND);
Comment #7
tebb commentedI've changed from:
file_put_contents('/tmp/backtrace.txt', print_r(debug_backtrace()), FILE_APPEND);
to:
file_put_contents('/tmp/backtrace.txt', print_r(debug_backtrace(), TRUE), FILE_APPEND);
Now I have a 13Mb file from a Warning at line 184 in entity.inc.
Shall I attach it to this entitycache issue or create one for entity?
I'm just trying to edit out the sitename, domain info and zip it.
Comment #8
tebb commentedI *can* recreate the error in #5 by going to any other page after visiting /user.
The same happens for http and https.
Most (all?) of the issues (entity, entity cache, entity token) disappear if I disable the Page Title module.
@eule: Do you have the Page Title module enabled?
Comment #9
catchCould you try disabling entitycache, but making no other changes, and see if you still get the error.
If you do, then this has nothing to do with entitycache.
Comment #10
eule commentedHi
sorry for reading this a bit late..some cache issue i mean
@Dru-p yep i have page title enabled 7.x-2.4-beta1 and thanks for the tip with the command line..but i´m not a pro and not using in drush..want to learn ;)
Comment #11
catchSince you both have page title installed, and Dru-p said the error went away if it was disabled, I'm going to move this issue over there.
Comment #12
eule commentedthanks guys
Comment #13
tebb commentedOK, I did some testing enabling and disabling modules.
Initially the issue looks to be in entity cache:
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in EntityCacheBaseController->load() (line 53 of /pathToD7/sites/all/modules/entitycache/entitycache.module).
Disabling entitiy cache moves the issue to entity.inc
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of /pathToD7/includes/entity.inc).
Then disabling Page Title removes the issue.
I guess this is what you would expect.
Comment #14
catchYep, that means it's at least not an issue with entitycache (or the core entity.inc).
Comment #15
andypostsubcribe
Comment #16
steven jones commentedThe arguments to
user_loadchanged in D6 -> D7 patch is on its way...Comment #17
steven jones commentedPatch attached fixes the issue.
Long-term you should not use the arg function though, menu_get_object is the way forward!
Comment #18
andypostSure, user_load() accepts $UID as parameter
Comment #19
nicholasthompsonThis is fixed in 7.x-2.x-dev. You can see here that the user.page_title.inc file uses menu_get_item instead now.
http://drupalcode.org/project/page_title.git/blob/refs/heads/7.x-2.x:/mo...
Cheers guys,
Nick