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)

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ndobromirov’s picture

Status: Active » Needs review
FileSize
873 bytes

Adding a patch that fixes the issues.

ndobromirov’s picture

Did someone looked into this?
It is quite straightforward implementation.
Please review!

Jose Reyero’s picture

Issue summary: View changes
Status: Needs review » Postponed (maintainer needs more info)

Yes, 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.

ndobromirov’s picture

I 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 :] .

Jose Reyero’s picture

Status: Postponed (maintainer needs more info) » Closed (won't fix)

The issue popped from some misbehaving contributed module(s)

Then 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.

guy_schneerson’s picture

Had the same issue but after upgrading to the latest version issue went away.
A small note: while not sure about the patch
the line

<?php
  if ($variable && !isset($included[$variable['name']])) {
?>

would read better:

<?php
  if (isset($variable) && !isset($included[$variable['name']])) {
?>

or

<?php
  if (!is_null($variable) && !isset($included[$variable['name']])) {
?>

As the function is declared as

<?php
function variable_include($variable = NULL) {
?>

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.