function qc_webforms_theme_registry_alter(&$theme_registry) {
unset($theme_registry['webform_form']['pattern']);
}
function qc_webforms_preprocess(&$vars, $hook) {
switch ($hook) {
case 'webform_form':
$vars['theme_hook_suggestions'][] = 'webform_form';
if(isset($vars['theme_hook_suggestion'])){
$vars['theme_hook_suggestions'][] = $vars['theme_hook_suggestion'];
$vars['theme_hook_suggestion'] = null;
}else{
$vars['theme_hook_suggestions'][] = 'webform_form_' . $vars['form']['#node']->nid;
}
$vars['theme_hook_suggestions'][] = 'webform_form__' . $vars['form']['#node']->webform['machine_name'];
break;
case 'node':
$view_mode = $vars['view_mode'];
if(isset($vars['webform'])){
$vars['theme_hook_suggestion'] = null;
$vars['theme_hook_suggestions'][] = 'node__webform__' . $vars['webform']['machine_name'];
$vars['theme_hook_suggestions'][] = 'node__webform__' . $vars['webform']['machine_name'] . '__' . $view_mode;
}
break;
}
}