drupalprojects / kalatheme

Mirror of http://drupal.org/project/kalatheme provided by hubdrop.
http://hubdrop.org/project/kalatheme
GNU General Public License v2.0
22 stars 29 forks source link

Call to undefined function kalatheme_process_element() #160

Open heatherfarrier opened 9 years ago

heatherfarrier commented 9 years ago

Fatal PHP errors when I am editing/adding content using kalatheme as the admin theme. I don't receive errors when using the Seven admin theme. Any ideas?

gboudrias commented 9 years ago

Using the latest 7.x-4.x commit I don't, I don't seem to have this error when editing (very basic) content, but this same error seems to be in the way of creating features (gives a WSOD). I'm sure this is just one of many places where it can turn up but that's where I saw it.

Here's the apache log: [Thu Mar 12 20:47:25 2015] [error] [client x.x.x.x] PHP Fatal error: Call to undefined function kalatheme_process_element() in /var/aegir/platforms/etc/includes/form.inc on line 1850 [etc]

Can't say I understand why this is the case, as the function clearly exists. Maybe parameter mismatch?

andrewmallis commented 9 years ago

WSOD on features can happen if jQuery update's set too high.

4.x is a bit unstable and contains experimental code we are parsing out to move into the main line of development instead.

gboudrias commented 9 years ago

It's at 1.7, which is the minimum I can set it to.

I tried after commenting out the function calls and no WSOD.

No complaints on the stability, it is to be expected :)

andrewmallis commented 9 years ago

The function seeks to make form elements more inline with boostrap's. Nothing bad from commenting it out

/**
 * Implements template_process_element().
 */
function kalatheme_process_element(&$element, &$form_state) {
  if (!empty($element['#attributes']['class']) && is_array($element['#attributes']['class'])) {
    if (in_array('container-inline', $element['#attributes']['class'])) {
      $element['#attributes']['class'][] = 'form-inline';
    }
    if (in_array('form-wrapper', $element['#attributes']['class'])) {
      $element['#attributes']['class'][] = 'form-group';
    }
  }
  return $element;
}

not qualified to recommend a proper fix

gboudrias commented 9 years ago

After further testing, the error only happens when the admin theme is NOT kalatheme. Therefore it might be enough to just check whether kalatheme is the current theme (even though I would assume Drupal does this by default?). A quick fix for those with this error is to set Kalatheme as your admin theme.

maxplus commented 9 years ago

Hi, I'm using 7.x-4.0-alpha1 and I have this issue only when I edit a Message Type and try to translate it. After I use the dropdown to switch the field language and try to save the message type, I receive the fatal error "Call to undefined function kalatheme_process_element()"

I have tried to comment out the function "function kalatheme_process_element(&$element, &$form_state)" but that does not solve the problem.

When I use Kalatheme or my Kalatheme-subtheme as admin theme, I don't get this error

maxplus commented 9 years ago

Hi Guys, I have read this comment on the Bootstrap theme issue que, and it solved my problem: https://www.drupal.org/node/2156371 => PHP config variable max_input_vars from 1000 to 1200 solved the problem for me.