Under the context section while adding a custom page, adding the Node Add Form works fine. But once in the layout view to add a pane, the modal window loads but continues to load for some time then an alert popup appears stating: An error occured while attempting to process /panels/ajax/add-pane/panel_context%3Apage-home_panel%3Apage_home_panel_panel_context/left.

This breaks all functionality of being able to add any further panes to the layout.

Comments

merlinofchaos’s picture

Can you update Panels and CTools to -dev and see what you get? There is increased error reporting that may help here.

triversedesigns’s picture

I updated to the dev version. For some reason the Page Manager, Views content panes and Panels were disabled after that.

The error I am getting is as follows: Unable to complete operation. Fatal error in /var/www/.../includes/form.inc on line 882: Allowed memory size of 100663296 bytes exhausted (tried to allocated 82 bytes).

triversedesigns’s picture

Any update on this?

merlinofchaos’s picture

Out of memory errors are hard to debug. Do you have a lot of modules on your site?

triversedesigns’s picture

Yes quite a few actually...Organic Groups is associated with the particular node form I am trying to add to the pane.

I am curious as to why only 82 Bytes were allocated.

merlinofchaos’s picture

Probably at that time a very small variable was allocated.

It is possible that the combination of modules you're using is legitimately eating your memory limit; but that would be a LOT of modules. It is possible that some module is leaking memory during this process too. These kinds of things are really hard to debug in PHP. Your best bet is to increase the memory limit to see.

hdornier’s picture

StatusFileSize
new20.53 KB

I have the same problem as mentionned above : "Under the context section while adding a custom page, adding the Node Add Form works fine. But once in the layout view to add a pane, the modal window loads but continues to load for some time then an alert popup appears stating". I've attached a capture of the popup.
Before I updated to the 6.X-3.3 version, all was fine. I updated both ctools and panels together. What's wrong?
Thanks a lot for your help

hdornier’s picture

StatusFileSize
new37.61 KB

@merlinofchaos : I've updated Panels and CTools to -dev to get the increased error reporting you tell. I've attached a capture of it.

TheInspector’s picture

I have the same problem too. The problem only appears when I add "add node" context, otherwise it works fine.

hdornier’s picture

Any suggestion? please, help us!

okday’s picture

I have the same error too.

someone have the solution?

pokurek’s picture

Version: 6.x-3.2 » 6.x-3.3

I use internalization module i18n (version 6.x-1.3) and a have found this cycle:

/modules/ctools/plugins/contexts/node_add_form.inc.ctools_context_create_node_add_form : lineno 34 ... and again the same call
/modules/ctools/includes/context.inc.ctools_context_get_context_from_context : lineno 1009
/modules/ctools/includes/context.inc.ctools_context_get_context_from_contexts : lineno 1041
/modules/ctools/includes/context.inc.ctools_context_load_contexts : lineno 1123
/modules/ctools/includes/context-task-handler.inc.ctools_context_handler_get_all_contexts : lineno 220
/modules/panels/panels.module.panel_context_panels_cache_get : lineno 1000
/drupal/includes/module.inc.call_user_func_array : lineno 0
/drupal/includes/module.inc.module_invoke : lineno 462
/modules/panels/includes/display-edit.inc.panels_edit_cache_get : lineno 18
/modules/panels/panels.module.panels_edit_cache_load : lineno 263
/drupal/includes/menu.inc._menu_load_objects : lineno 410
/drupal/includes/menu.inc._menu_translate : lineno 566
/drupal/includes/menu.inc.menu_get_item : lineno 316
/drupal/includes/menu.inc.menu_get_object : lineno 701
/modules/i18n/i18n.module.i18n_textfield_process : lineno 242
/drupal/includes/form.inc._form_builder_handle_input_element : lineno 1057
/drupal/includes/form.inc.form_builder : lineno 883
/drupal/includes/form.inc.form_builder : lineno 924
/drupal/includes/form.inc.form_builder : lineno 924
/modules/ctools/includes/form.inc.ctools_process_form : lineno 224
/modules/ctools/includes/form.inc.ctools_build_form : lineno 101
/modules/ctools/plugins/contexts/node_add_form.inc.ctools_context_create_node_add_form : lineno 67 ... first call
/modules/ctools/includes/context.inc.ctools_context_get_context_from_context : lineno 1009
/modules/ctools/includes/context.inc.ctools_context_get_context_from_contexts : lineno 1041
/modules/ctools/includes/context.inc.ctools_context_load_contexts : lineno 1123
/modules/ctools/includes/context-task-handler.inc.ctools_context_handler_get_all_contexts : lineno 220
/modules/panels/panels.module.panel_context_panels_cache_get : lineno 1000
/drupal/includes/module.inc.call_user_func_array : lineno 0
/drupal/includes/module.inc.module_invoke : lineno 462
/modules/panels/includes/display-edit.inc.panels_edit_cache_get : lineno 18
/modules/panels/panels.module.panels_edit_cache_load : lineno 263
/drupal/includes/menu.inc._menu_load_objects : lineno 410
/drupal/includes/menu.inc._menu_translate : lineno 566
/drupal/includes/menu.inc.menu_get_item : lineno 316
/drupal/includes/menu.inc.menu_execute_active_handler : lineno 343
/drupal/index.php.{main} : lineno 18

Module I18n add form process callback that calls menu_get_object function:

/**
 * Implementation of hook_elements().
 *
 * Add a process callback for textfields.
 */
function i18n_elements() {
  $type = array();
  $type['textfield'] = array('#process' => array('i18n_textfield_process'));
  return $type;
}

/**
 * Process callback for textfield elements.
 *
 * When editing or translating a node, set Javascript to rewrite autocomplete
 * paths to use the node language prefix rather than the current content one.
 */
function i18n_textfield_process($element) {
  global $language;
  static $sent = FALSE;

  // Ensure we send the Javascript only once.
  if (!$sent && isset($element['#autocomplete_path']) && !empty($element['#autocomplete_path']) && variable_get('language_negotiation', LANGUAGE_NEGOTIATION_NONE) != LANGUAGE_NEGOTIATION_NONE) {
    // Add a JS file for node forms.
    // Determine if we are either editing or translating an existing node.
    // We can't act on regular node creation because we don't have a specified
    // node language.
    $node_edit = $node = menu_get_object() && arg(2) == 'edit' && isset($node->language) && !empty($node->language);
    $node_translate = arg(0) == 'node' && arg(1) == 'add' && !empty($_GET['translation']) && !empty($_GET['language']);
    if ($node_edit || $node_translate) {

Everything is in order If I disable i18n module.

I hope this help with detection where the problem is.

triversedesigns’s picture

Hmmm I think this may help, I had the issue originally only when using the OG module...

pokurek’s picture

@merlinofchaos : Hi. I think, there is no possibility to recognize that the context is created in menu_get_item() function.
So we can only prevent to call context function recursively.

Testing static variable works for me.

file: ctools/plugins/contexts/node_add_form.inc

/**
 * It's important to remember that $conf is optional here, because contexts
 * are not always created from the UI.
 */
function ctools_context_create_node_add_form($empty, $data = NULL, $conf = FALSE) {
  static $created;
  $context = new ctools_context(array('form', 'node_add', 'node_form'));
  $context->plugin = 'node_add_form';

  // Prevent to cycle
  if ($empty || (isset($created) && $created)) {
    return $context;
  }
  $created = true;

webdevbyjoss’s picture

Hi, the patch from #14 resolves the out of memory issue for me. Thanks! Any chance to incorporate the fix for this issue into official release?

shadowx’s picture

This error could also be found in node_edit_form.inc. It could be solved by the #14 patch, too.

gunzip’s picture

i can confirm the patch also solves a problem i've got when adding node form from context:

Unable to complete operation. Fatal error in form.inc on line 1332: Maximum function nesting level of 100 reached, aborting!

i think the patch should be incorporated in latest dev. maybe set this to review and tested ?

pokurek’s picture

Status: Active » Reviewed & tested by the community
StatusFileSize
new1.78 KB

Sending patch in attach.

erik seifert’s picture

patch is working for me.

thx

merlinofchaos’s picture

Project: Panels » Chaos Tool Suite (ctools)
Version: 6.x-3.3 » 6.x-1.x-dev
Component: Panel pages » Miscellaneous

Committed. THis was a CTools issue, so moving.

merlinofchaos’s picture

Status: Reviewed & tested by the community » Fixed

Forgot to mark fixed.

majdi’s picture

patch is working for me
thanks

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.