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.
The following notices are experienced during a settings form save.
Notice: Undefined index: name in variable_children()
(line 81 of /home/.../sites/all/modules/contrib/variable/variable.module)
Notice: Undefined index: name in variable_include()
(line 466 of /home/.../sites/all/modules/contrib/variable/variable.module)
Notice: Undefined index: module in variable_include()
(line 468 of /home/.../sites/all/modules/contrib/variable/variable.module)
Notice: Undefined index: type in variable_include()
(line 469 of /home/.../sites/all/modules/contrib/variable/variable.module)
Comment | File | Size | Author |
---|---|---|---|
#1 | variable-notices-in-variable-children-and-variable-include-2077081-1.patch | 873 bytes | ndobromirov |
Comments
Comment #1
ndobromirov CreditAttribution: ndobromirov commentedAdding a patch that fixes the issues.
Comment #2
ndobromirov CreditAttribution: ndobromirov commentedDid someone looked into this?
It is quite straightforward implementation.
Please review!
Comment #3
Jose Reyero CreditAttribution: Jose Reyero commentedYes, the patch looks good, though I'm wondering how can this happen since variable_build should return a complete variable array (with name).
Also I haven't seen the notice yet .
And anyway, I'm not sure we want to hide that notices, we should fix the bug producing that incomplete $variable array instead.
Comment #4
ndobromirov CreditAttribution: ndobromirov commentedI am working in some large project currently topping 250 enabled modules.
The issue popped from some misbehaving contributed module(s) and I was not able to easily find the real culprit, so this solution is the result.
No side effects are experienced after the patch 4+ months now.
I'll look back into this when some free time is available :] .
Comment #5
Jose Reyero CreditAttribution: Jose Reyero commentedThen this would be just a way to hide the issue, which we really don't want to do.
If a module defines wrong data, we better have an error and try to fix that one because just hiding it can make it go unnoticed forever.
Comment #6
guy_schneerson CreditAttribution: guy_schneerson commentedHad the same issue but after upgrading to the latest version issue went away.
A small note: while not sure about the patch
the line
would read better:
or
As the function is declared as
and is called in a couple of places with no argument.
Not saying its a bug but will make help the code easier to read.