Steps to reproduce:

  1. Install Ctools and Panels, latest versions
  2. Create a Panel using Node edit form: node ID context for an argument
  3. Add some field editing panes to that panel and node form submit buttons
  4. Save the panel and edit some node with the just defined panel form
  5. On save, there is WSOD and PHP fatal error occurs: PHP Fatal error: Call to undefined function bootstrap_form_process() in mydirectory/includes/form.inc on line 1850

I'm using latest version of Bootstrap. It works fine with Bartik theme. Is this somehow related to https://www.drupal.org/node/2156371?

I tried to create custom module with:

function bootfix_init() {
		include_once(drupal_get_path('theme', 'bootstrap') . '/includes/process.inc');
}

but it didn't help.

EDIT: The strange thing is that this error doesn't happen, if I enable and override default node_edit page. Export of both pages is enclosed.

CommentFileSizeAuthor
#2 ctools_pages_export.txt7.99 KBmilos.kroulik
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

milos.kroulik created an issue. See original summary.

milos.kroulik’s picture

Issue summary: View changes
FileSize
7.99 KB
clemens.tolboom’s picture

Status: Active » Closed (duplicate)
Parent issue: » #2156371: Fatal error: Call to undefined function _bootstrap_process_element()

This is probably a duplicate of #2156371: Fatal error: Call to undefined function _bootstrap_process_element() which is closed as they think it's a core issue. I close this as #2156371: Fatal error: Call to undefined function _bootstrap_process_element() has more information. Feel free to reopen but better comment on the other issue.

MartijnBraam’s picture

Status: Closed (duplicate) » Active

I've just stumbled across this issue and it's not in all cases related to the other issue.

This exact error can also happen if you have a drupal form with a lot of fields. In my case I have around 150 fields on my edit page because of a gallery with the paragraphs module. If you cross max_input_vars limitation in php you get the error in this issue in addition to this one:

PHP Warning:  Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini. in Unknown on line 0

If you raise the max_input_vars limit in php then the bootstrap_form_process() error is also solved. I haven't looked under the hood to check why this is happening but i guess that php corrupts the form when you have to many fields.

chobart’s picture

As wrote MartijnBraam increasing max_input_vars in php.ini solves the problem.

markhalliwell’s picture

Category: Bug report » Support request
Status: Active » Closed (duplicate)

It is, in fact, a duplicate of the related issue aforementioned.

tarekdj’s picture

For the record : I fixed it using this little hack (You need to patch bootstrap theme)
https://gist.github.com/tarekdj/d924005620d4b942f4e3bc1fe8e28c2b

jienckebd’s picture

This is a duplicate of https://www.drupal.org/node/2156371 . The Ajax updates from Panels are causing the same problem as the Ajax updates in that issue.

As markcarver pointed out several times in that issue, this is not an issue with the Bootstrap theme. But you can add the below to one of your modules as a bandaid to keep your site running.

function MODULE_NAME_custom_theme() {
  if (current_path() == 'system/ajax') {
    return variable_get('admin_theme');
  }
}

This will restore the admin theme in the Ajax callback. This worked for me, but I imagine it could have a negative effect in some cases for Ajax requests not within the admin theme. But it's working okay for my site.

Stanislav_B’s picture

To fix this issue in my project i have used solution similar to provided in #8, but with little changes:

<?php
function bootstrap_theme_bugfix_custom_theme(){
    if('system/ajax' === current_path()){
       if(isset($_POST['ajax_page_state']['theme'])){
           $themes = list_themes();
           if(isset($themes[$_POST['ajax_page_state']['theme']]) && !empty($themes[$_POST['ajax_page_state']['theme']]->status)){
               return $_POST['ajax_page_state']['theme'];
           }
       }
    }
    return variable_get('theme_default', 'bartik');    
}

?>
Helice’s picture

#4 solved my problem. Thank you!

Anonymous’s picture

#8 fixed the issue for me... I didn't have to add the patch to bootstrap theme just create a module as its said there. Thank you !!!

markhalliwell’s picture

Neither #8 nor #9 should be needed.

That is the whole point behind why drupal_theme_initialize() adds the current page's theme key to ajaxPageState in Drupal settings and why system/ajax uses the theme callback ajax_base_page_theme() in system_menu().

Suffice it to say, if a contrib module is borking because of the above, it sounds like it IS NOT USING the system/ajax callback or core's Ajax API properly in the first place.

If it's using its own AJAX callback path, then it will need to either Implement the theme callback ajax_base_page_theme() in it's menu hook definition or something that essentially mimics that theme callback so it returns the proper theme.

arne_hortell’s picture

#4 worked for me, perfect result.

eaajithe’s picture

#4 worked for me
I checked my php.ini
; How many GET/POST/COOKIE input variables may be accepted
max_input_vars = 2500

then increased it up 10000
; How many GET/POST/COOKIE input variables may be accepted
max_input_vars = 10000

Restarted Apache. Error Gone

Bobby Endarr Ramdin’s picture

This error had me scratching my head.
max_input_vars is already set to 10000 in php info reading off the server.
It happened only when logged in as admin and not using bootstrap theme, so I've read try stark, seven bartik they didn't work.
When I set the admin default to bootstrap the error disappears..
So using Bootstrap for both anonymous and admin worked for me /// Drupal 7

nugten’s picture

#8 worked for me. Thank you very much!!

function MODULE_NAME_custom_theme() {
  if (current_path() == 'system/ajax') {
    return variable_get('admin_theme');
  }
}

(code copied from comment #8)

philsward’s picture

Since the "duplicate" is locked, I'll throw out over here that max_input_vars = 1500 worked for me.

For anyone who increases that value and it doesn't work, make sure the phpinfo file shows that the value has been updated. Some folks say that increasing it to 2000 worked for them.

MAKE SURE YOU RESTART APACHE. I increased the value using the cPanel EA4 PHP INI Editor, saved it and still ended up having to restart apache. Don't assume your system has properly updated the value if you're using a GUI editor. Check and make sure it has updated.

nrashok’s picture

#4 solved my problem. Thanks a ton

samhaldia’s picture

#4 Solves this issue for me as well.

DuneBL’s picture

#4 solve my day

trudog’s picture

None of the solutions above worked for me. It turned out that, in my case, it was a ThemeKey issue. I was able to fix the error by adding the theme as a "safe theme" in ThemeKey ajax settings.

miguelbraga’s picture

Hi trudog, what is this solution you are suggesting? I'm not a developer and I'm facing the same problem with adminimal.