Notice: Undefined index: default_filename in defaultconfig_defaultconfig_components() (line 418 of C:\wamp\www\panopoly\profiles\panopoly\modules\contrib\defaultconfig\defaultconfig.module).

Comments

liza’s picture

i also started getting this error message and have no idea why

populist’s picture

Status: Active » Postponed (maintainer needs more info)

This may no longer be an issue with the latest version of CTools, but do you have a replication case (i.e. what do you do to get the error?)

sproets’s picture

Just surfing to admin/modules page gives me the error...

tchopshop’s picture

I have ctools 7.x-1.3 and it happens when I go to update.php

temkin’s picture

I have the same issue with ctools 7.x-1.3. Happens to me when I go to update.php.

Let me know if you need more info from me.

timbrandin’s picture

We only get this Notice when installing through the UI.
Can't really figure out why drush get's by without showing the notice.. // T

timbrandin’s picture

Status: Postponed (maintainer needs more info) » Needs review
StatusFileSize
new471 bytes

Here's a solution that suppresses the notice if the index isn't set. Please correct it if you don't prefer php suppressions in favor of if-isset statements.

dale42’s picture

Using this configuration:

  • Drupal 7.22
  • Features 7.x-2.0-rc1
  • Ctools 7.x-1.3
  • Default Configuration 7.x-1.0-alpha9 or 7.x-1.0-alpha9+0-dev
  • Features Extra 7.x-1.0-beta1

I can reproduce the problem as follows:

  • Enable Features, Ctools, Default Configuration, and FE Block (Features Extra)
  • Go to the Create Feature page
  • The "undefined index" error message is displayed

Features Extra Block can be confirmed as the cause by placing the following line of code in the foreach loop at line 411:

if (!array_key_exists('default_filename', $info)) drupal_set_message('<pre>'. print_r($info, 1) .'</pre>');

For me this produced:

Array
(
    [name] => FE Block
    [default_hook] => default_fe_block_boxes
    [default_file] => 2
    [module] => fe_block
    [feature_source] => 1
)

I'm not sure if the problem is that Default Config expects default_filename to be defined and shouldn't, or if FE Block should be providing a default_filename and isn't.

mixxmac’s picture

Thanks for the info.

I just tried debugging the foreach loop using the same way as @dale42, and it's the currency module that shows up in my case.

Disabling the currency module, or using @timbrandin's code stops the error message from showing up.

I'm using 7.22 (Open Atrium) and get the errors on the admin/modules page...

Array
(
    [name] => Currency
    [default_hook] => currency_info
    [default_file] => 2
    [module] => currency
    [feature_source] => 1
)
Array
(
    [name] => Currency
    [default_hook] => currency_locale_pattern_info
    [default_file] => 2
    [module] => currency
    [feature_source] => 1
)
Notice: Undefined index: default_filename in defaultconfig_defaultconfig_components() (line 420 of /.../profiles/openatrium/modules/contrib/defaultconfig/defaultconfig.module). Backtrace:
defaultconfig_defaultconfig_components() 
call_user_func_array('defaultconfig_defaultconfig_components', Array) module.inc:857
module_invoke_all('defaultconfig_components') defaultconfig.module:352
defaultconfig_get_components() defaultconfig.features.inc:52
defaultconfig_features_export_render('panopoly_widgets', Array, NULL, 'defaultconfig') 
call_user_func_array('defaultconfig_features_export_render', Array) features.module:539
features_invoke('defaultconfig', 'features_export_render', 'panopoly_widgets', Array, NULL) features.export.inc:705
features_get_normal('defaultconfig', 'panopoly_widgets', ) features.export.inc:637
features_get_signature('normal', 'panopoly_widgets', 'defaultconfig', ) features.export.inc:864
features_get_component_states(Array, 1, ) features.module:877
_features_restore('rebuild', Array) features.module:923
features_rebuild() features.module:839
features_form_system_modules_alter(Array, Array, 'system_modules', NULL) module.inc:1063
drupal_alter(Array, Array, Array, 'system_modules') form.inc:1085
drupal_prepare_form('system_modules', Array, Array) form.inc:340
drupal_build_form('system_modules', Array) form.inc:131
drupal_get_form('system_modules') 
call_user_func_array('drupal_get_form', Array) menu.inc:517
menu_execute_active_handler() index.php:21
Notice: Undefined index: default_filename in defaultconfig_defaultconfig_components() (line 420 of /.../profiles/openatrium/modules/contrib/defaultconfig/defaultconfig.module). Backtrace:
defaultconfig_defaultconfig_components() 
call_user_func_array('defaultconfig_defaultconfig_components', Array) module.inc:857
module_invoke_all('defaultconfig_components') defaultconfig.module:352
defaultconfig_get_components() defaultconfig.features.inc:52
defaultconfig_features_export_render('panopoly_widgets', Array, NULL, 'defaultconfig') 
call_user_func_array('defaultconfig_features_export_render', Array) features.module:539
features_invoke('defaultconfig', 'features_export_render', 'panopoly_widgets', Array, NULL) features.export.inc:705
features_get_normal('defaultconfig', 'panopoly_widgets', ) features.export.inc:637
features_get_signature('normal', 'panopoly_widgets', 'defaultconfig', ) features.export.inc:864
features_get_component_states(Array, 1, ) features.module:877
_features_restore('rebuild', Array) features.module:923
features_rebuild() features.module:839
features_form_system_modules_alter(Array, Array, 'system_modules', NULL) module.inc:1063
drupal_alter(Array, Array, Array, 'system_modules') form.inc:1085
drupal_prepare_form('system_modules', Array, Array) form.inc:340
drupal_build_form('system_modules', Array) form.inc:131
drupal_get_form('system_modules') 
call_user_func_array('drupal_get_form', Array) menu.inc:517
menu_execute_active_handler() index.php:21
seanr’s picture

I'm getting this with FlexSlider Picture (included with the Picture module). Where does the data in the offending array even come from? The FlexSlider Picture module doesn't even use features, so why would it be getting referenced here? The patch in #7 would work, but I'd refer to understand and fix the root cause if possible instead.

bobodrone’s picture

Here is a another patch that just disregards modules that do not have defined a default_filename.

// bobodrone

barry_fisher’s picture

Issue summary: View changes
StatusFileSize
new721 bytes

This patch would be my preferred choice of suppression- using !empty() in ternary conditional statement inline with the array key => value.

This for me, was relating to FE Block (part of features_extra). I'm not sure of the ramifications elsewhere but this helped suppress the PHP notice in my case.

barry_fisher’s picture

StatusFileSize
new513 bytes

I actually had this crop up again on another project and forgot all about it- even though it was a few weeks ago. I'm sure my mind is like a sieve sometimes!

Anyway, I now realise that the patch I previously attached was not relative to the defaultconfig module so I'm reattaching with this corrected.

Can anyone else duplicate this issue and verify this patch works, in the hope it can be committed? You should be able to duplicate this notice error quite easily by running a standard panopoly install and then install the features_extra module- in particular fe_block. Then navigate to the features create/recreate pages.

loopduplicate’s picture

Status: Needs review » Reviewed & tested by the community

Reallifedesign, thanks :)

Tested and reviewed, looks good!

Cheers, Jeff

revagomes’s picture

Thanks @Reallifedesign!

Worked well for the FE Block issue pointed by @dale42 at #8.

alexbarrett’s picture

I've encountered this issue while using FE Block as well. The issue is that _ctools_features_get_info() only sets the 'default_filename' item if $schema['export']['api'] is set in hook_schema() (not part of Drupal Core but used by CTools Export API. If you look at fe_block_schema() in fe_block.install you can see that there is no 'api' declaration under 'export'.

The only reference I can find to this is proposed patch to FE Block 3 years ago #1287514: Feature extra block boxes is incompatible with Features > 1.0-beta3 that was never committed.

I'm not familiar enough with the CTools Export API to know if the patch to FE Block is required, or if the bug lies in Default config or FE Block. Anyone have any ideas?

kclarkson’s picture

Thanks @Reallifedesign!

Just git cloned the repository applied the patch and error has gone away.

RTBC

PI_Ron’s picture

This notice popped it's head up for me as soon as I enabled fe_block.

Applied the patch to defaultconfig-7.x-1.0-alpha9 fixed the notice.

Thanks :-)

barry_fisher’s picture

StatusFileSize
new529 bytes

Re-rolling against 7.x-1.0-alpha11

chrisgross’s picture

StatusFileSize
new513 bytes

Patch #19 does not apply against alpha11. Looks like a whitespace issue. Here's an updated patch.

puregin’s picture

The patch at #20 fixes the issue for me. Thanks!

joseph.olstad’s picture

subscribing, we needed this too.

PATCH 20 does the job! Thanks!

rahul_sankrit’s picture

I were facing the same issue :

Notice: Undefined index: default_filename in defaultconfig_defaultconfig_components() (line 434 of /modules/contrib/defaultconfig/defaultconfig.module).

Fixes for me :

diff --git a/defaultconfig.module b/defaultconfig.module
index 649fed0..220299e 100644
--- a/defaultconfig.module
+++ b/defaultconfig.module
@@ -431,7 +431,7 @@ function defaultconfig_defaultconfig_components() {
         'features component' => $name,
         // We can't register CTools files as groups,
         // it causes a lot of things to fail.
-        'group' => $info['default_filename'],
+        'group' => !empty($info['default_filename']) ? $info['default_filename'] : NULL,
       );
     }
   }

Thanks to patch
https://www.drupal.org/node/1900574#comment-10741516 fixes the issue for me.

Thanks

wylbur’s picture

Another successful patch for us using #20.

danielveza’s picture

No commits to this module for years. But might as well add another RTBC. Worked for us.