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.
Running core 7.26, (but also when I was running core 7.23!) am receiving the following notice:
Undefined index: file in .... sites/all/modules/devel/devel.module on line 2017.
The relevant line is:
$path = $backtrace[$counter - 1]['file'];
Any thoughts? Could it be the version of php I am running (5.4.26)? $backtrace
is populated with a call to debug_backtrace()
which should according to the php manual include an element with key "file". Stumped.
In case it helps, the output of $backtrace
as it arrives at line 2017 is attached. I think the culprit is evident.
Comment | File | Size | Author |
---|---|---|---|
#3 | debug_backtrace.png | 52.29 KB | howwwie |
Comments
Comment #1
howwwie CreditAttribution: howwwie commentedComment #2
howwwie CreditAttribution: howwwie commentedComment #3
howwwie CreditAttribution: howwwie commentedComment #4
SocialNicheGuru CreditAttribution: SocialNicheGuru commentedI am getting this too. php5.5
Comment #5
suntower CreditAttribution: suntower commentedMe too. php5.5. Seems to have started after updating Commerce to latest version and core from 7.26 to 7.32... though that could be a red herring?
I'm fairly new to Drupal... workaround?
Comment #6
sfbob CreditAttribution: sfbob commentedMe too. core 7.34, php 5.2.17
Comment #7
kenorb CreditAttribution: kenorb commentedComment #8
kenorb CreditAttribution: kenorb commentedBacktrace: theme_get_setting-> backtrace_error_handler->ddebug_backtrace( $return = TRUE, $pop = -1)
Affected code:
Local vars:
So it seems 5 element from $backtrace doesn't have file key.
Comment #9
kenorb CreditAttribution: kenorb commentedPossible fix:
Comment #10
salvisYes, and what about 'line'?
Patch must go against the -dev version, if the issue is still there...
Is it also in D8?
Comment #11
Joel MMCC CreditAttribution: Joel MMCC commentedOver a year after the most recent comment prior to this one, and the problem is still happening for me (with version 7.x-1.5 — changing to the latest -dev of 2017-Jan-10 changes the line number of the error message to 1980 instead of 2017 but does nothing else to fix it).
EDIT to add: Applying @kenorb’s fix manually from #9 makes the error message go away, but no SQL queries are shown even on a page with Views output which should be loaded with them. It prevents the error message, but does not fix the underlying problem.
Comment #12
salvisYeah, it's too bad that no one ever cared enough to post a patch.
I encountered and fixed it in #2959508: PHP 7.2 Incompatibility - count(): Parameter must be an array or an object that implements Countable in krumo::_object