How to find which module is causing PHP warning

by TBJ   Last Updated January 04, 2018 14:07 PM

In the Recent log messages I get this message repeated many times:

Warning: array_flip(): Can only flip STRING and INTEGER values! i DrupalDefaultEntityController->cacheGet() (rad 388 av C:\wamp\www\includes\

I assume that the problem lies within one of the modules I have installed, but after spending the whole day trying to narrow down which module is causing the problem, without luck, I post this question. I have read other answers that relates to the same log message, but they did not help me.

Anyone that can explain how to get more info out of that warning?

Answers 1

Best way is probably to use a debugguer like xdebug and watch the callstack in your IDE before your warning.

If you cannot, use debug_print_backtrace() or debug_backtrace(), locate your warning and you will see all the calls before it happens.

Here is an exemple your have to adapt (or not) : set_error_handler()

January 04, 2018 13:53 PM

Related Questions

How to debug EntityMalformedException?

Updated March 03, 2016 04:03 AM

D8 - Custom EntityType - Error when translatable

Updated May 17, 2018 15:07 PM