Closed (fixed)
Project:
Webform steps
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
9 Jun 2015 at 09:39 UTC
Updated:
1 Jul 2015 at 19:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
raines37 commentedComment #2
raines37 commentedComment #3
raines37 commentedComment #4
raines37 commentedComment #5
torotil commentedIt seems that
$theme['webform_form']['template']holds the full path to the template at that time. Does the following patch work for you too?Comment #6
torotil commentedComment #7
jaskaran.nagra commentedHi,
Thanks for putting through an awesome module :)
Patch #2 works for me whereas patch #5 doesn't.
I think for #5
$hook['template'] = $hook['path'] . '/webform-form';
should be
$hook['webform_form']['template'] = $hook['path'] . '/webform-form';
While we are on it, do you think it is a good idea to change the names of the webform3.php and webform4.php files to .inc , drupal uses .inc to avoid php scripts being run from outside.
And is there any way to avoid altering the theme registery?
Comment #8
torotil commentedThat means that it should be set to the full path of the new template, right? At least that is what happens there wasn't an hook_theme_registry_alter() implementation.
What symptoms do you see when
$theme['webform_form']['template']is set to a wrong value? (What's your actual problem?)Or with other words. Why should the value of
$theme['webform_form']['template']be just'webform-form'instead of$new_path . '/webform-form'?No that should be fine $hook['template'] == $theme['webform_form']['template'].
As there is no top-level code (code that isn't inside a function or class) in those files executing those files does exactly nothing. I don't think a php-file should have any other extension than .php.
Comment #9
yareckon commentedThe problem was that ['theme path'] not ['path'] should be set in the alter hook according to this comment:
https://api.drupal.org/comment/29013#comment-29013
The broken symptom before the patch was indeed a double gluing together of paths:
where .../ is my drupal docroot.
Attached is your patch, but setting theme path instead.
Comment #10
torotil commentedAfter re-reading _theme_process_registry() and theme() I think the easiest is to simply set $hook['template'] and leave everything else untouched. I'd opt against setting $hook['theme path'] (which should point to a theme/profile/module directory) as we don't want to replace anything other than the template. $hook['path'] is only useful when it's set during hook_theme().
Comment #11
mmartinov commented#10 works for me, no more PHP warnings in the error log.
Comment #12
torotil commentedCommitted to 7.x-2.x.