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.
Hi,
after clear cache the following error message appears:
Notice: Undefined index: export in ctools_export_crud_load() (line 75 of modules/ctools/includes/export.inc).
To avoid empty schema handling I've added an extra if to that line which fixed that bug:
function ctools_export_crud_load($table, $name) {
$schema = ctools_export_get_schema($table);
if(is_array($schema) && !empty($schema)){
$export = $schema['export'];
if (!empty($export['load callback']) && function_exists($export['load callback'])) {
return $export['load callback']($name);
}
else {
$result = ctools_export_load_object($table, 'names', array($name));
if (isset($result[$name])) {
return $result[$name];
}
}
}
}
Comments
Comment #1
hass CreditAttribution: hass commentedPossible duplicate of #1098292: Notice: Undefined index: export in ctools_export_crud_load() (line 75 of ctools/includes/export.inc).
Comment #2
hass CreditAttribution: hass commentedThe source of this issue is a NULL value in $table. Therefore the condition is too late. Aside of this there are several functions that can also break the same way with NULL in $table.
Comment #3
swentel CreditAttribution: swentel commented@frizi, can you try changing the code to this for a minute:
That way we can try and identity throught this trace where the problem might be.
Comment #4
esmerel CreditAttribution: esmerel commentedComment #5
BDaggerhart CreditAttribution: BDaggerhart commentedI've been getting this notice recently as well, usually after clearing caches and/or running cron. I've read this thread and 3 others that have similar notices, and am not sure what to do about it. Any advice?
Comment #6
realityloop@swentel
When trying to save a context:
Array ( [0] => Array ( [file] => /var/aegir/platforms/fv-7.39/profiles/family_violence/modules/contrib/ctools/plugins/export_ui/ctools_export_ui.class.php [line] => 47 [function] => ctools_export_crud_load [args] => Array ( [0] => [1] => layout-not_front ) ) [1] => Array ( [file] => /var/aegir/platforms/fv-7.39/profiles/family_violence/modules/contrib/ctools/ctools.module [line] => 873 [function] => load_item [class] => ctools_export_ui [object] => ctools_export_ui Object ( [plugin] => [name] => [options] => Array ( ) ) [type] => -> [args] => Array ( [0] => layout-not_front ) ) [2] => Array ( [function] => ctools_export_ui_load [args] => Array ( [0] => layout-not_front [1] => context ) ) [3] => Array ( [file] => /var/aegir/platforms/fv-7.39/includes/menu.inc [line] => 592 [function] => call_user_func_array [args] => Array ( [0] => ctools_export_ui_load [1] => Array ( [0] => layout-not_front [1] => context ) ) ) [4] => Array ( [file] => /var/aegir/platforms/fv-7.39/includes/menu.inc [line] => 763 [function] => _menu_load_objects [args] => Array ( [0] => Array ( [path] => admin/structure/context/list/%/edit [load_functions] => a:1:{i:4;a:1:{s:21:"ctools_export_ui_load";a:1:{i:0;s:7:"context";}}} [to_arg_functions] => [access_callback] => _tweaker_menu_access_callback [access_arguments] => a:5:{i:0;s:51:"admin/structure/context/list/%ctools_export_ui/edit";i:1;s:28:"ctools_export_ui_task_access";i:2;s:7:"context";i:3;s:4:"edit";i:4;i:4;} [page_callback] => ctools_export_ui_switcher_page [page_arguments] => a:3:{i:0;s:7:"context";i:1;s:4:"edit";i:2;i:4;} [delivery_callback] => [fit] => 61 [number_parts] => 6 [context] => 1 [tab_parent] => admin/structure/context/list/% [tab_root] => admin/structure/context/list/% [title] => Edit [title_callback] => t [title_arguments] => [theme_callback] => [theme_arguments] => a:0:{} [type] => 140 [description] => [position] => [weight] => -10 [include_file] => profiles/family_violence/modules/contrib/ctools/includes/export-ui.inc ) [1] => Array ( [0] => admin [1] => structure [2] => context [3] => list [4] => layout-not_front [5] => edit ) ) ) [5] => Array ( [file] => /var/aegir/platforms/fv-7.39/includes/menu.inc [line] => 474 [function] => _menu_translate [args] => Array ( [0] => Array ( [path] => admin/structure/context/list/%/edit [load_functions] => a:1:{i:4;a:1:{s:21:"ctools_export_ui_load";a:1:{i:0;s:7:"context";}}} [to_arg_functions] => [access_callback] => _tweaker_menu_access_callback [access_arguments] => a:5:{i:0;s:51:"admin/structure/context/list/%ctools_export_ui/edit";i:1;s:28:"ctools_export_ui_task_access";i:2;s:7:"context";i:3;s:4:"edit";i:4;i:4;} [page_callback] => ctools_export_ui_switcher_page [page_arguments] => a:3:{i:0;s:7:"context";i:1;s:4:"edit";i:2;i:4;} [delivery_callback] => [fit] => 61 [number_parts] => 6 [context] => 1 [tab_parent] => admin/structure/context/list/% [tab_root] => admin/structure/context/list/% [title] => Edit [title_callback] => t [title_arguments] => [theme_callback] => [theme_arguments] => a:0:{} [type] => 140 [description] => [position] => [weight] => -10 [include_file] => profiles/family_violence/modules/contrib/ctools/includes/export-ui.inc ) [1] => Array ( [0] => admin [1] => structure [2] => context [3] => list [4] => layout-not_front [5] => edit ) ) ) [6] => Array ( [file] => /var/aegir/platforms/fv-7.39/includes/menu.inc [line] => 1757 [function] => menu_get_item [args] => Array ( ) ) [7] => Array ( [file] => /var/aegir/platforms/fv-7.39/includes/menu.inc [line] => 1772 [function] => menu_get_custom_theme [args] => Array ( [0] => 1 ) ) [8] => Array ( [file] => /var/aegir/platforms/fv-7.39/includes/common.inc [line] => 5243 [function] => menu_set_custom_theme [args] => Array ( ) ) [9] => Array ( [file] => /var/aegir/platforms/fv-7.39/includes/bootstrap.inc [line] => 2262 [function] => _drupal_bootstrap_full [args] => Array ( ) ) [10] => Array ( [file] => /var/aegir/platforms/fv-7.39/index.php [line] => 20 [function] => drupal_bootstrap [args] => Array ( [0] => 7 ) ) )
Error messageNotice: Undefined index: export in ctools_export_crud_load() (line 80 of /var/aegir/platforms/fv-7.39/profiles/family_violence/modules/contrib/ctools/includes/export.inc).
The requested page "/admin/structure/context/list/layout-not_front/edit" could not be found.
Comment #7
realityloopComment #8
realityloopComment #9
Deciphered CreditAttribution: Deciphered as a volunteer commentedSo this is an issue I've seen in multiple modules that use CTools plugins. I'm not sure if I've ever reported it in CTools itself, rather I've dealt with it in various different modules on behalf of the developers.
The issue is related to the way CTools loads plugins with
require_once
, as if for some reason in that same runtime if that plugin is required, then some cache is cleared, and then something else is requiring that plugin definition things go bad, because the second request for that plugin definition doesn't work due to the file already being included/required.The solution I recommend to modules having this issue is to declare their plugin definition with the partially unknown plugin definition hook:
MODULE_NAME_PLUGIN_NAME_ctools_PLUGIN_TYPE()
.Ideally this issue should probably be dealt with at the source, but I suspect that will be a massive job.
I will try to take some time to create some a proper reproducible set of steps to show this issue, as this is a very difficult issue to actually witness and debug.
Comment #10
Deciphered CreditAttribution: Deciphered as a volunteer commentedTwo issues I've previously dealt, both with some details related to this issue:
#2386819: Encrypt/Decrypt and cache clear issue with CTools plugin system
#2513714: CTools plugin issue
Comment #11
dasj19 CreditAttribution: dasj19 as a volunteer commentedI am experiencing the same issue.. any fix for this?
Comment #12
dasj19 CreditAttribution: dasj19 as a volunteer commented