Hi,

I have created a custom layout for my page by setting the tpl file in my custom module then placing the tpl file in my theme directory. Everything works perfectly for users. The problem is, when I am logged in using the Admin interface and try to add a user I get the following error message:

Warning: include(/u/s/sim-one/www.sim-one.ca/sites/all/modules/simone_forms/user-register-form.tpl.php): failed to open stream: No such file or directory in theme_render_template() (line 1495 of /u/s/sim-one/www.sim-one.ca/includes/theme.inc).
Warning: include(): Failed opening '/u/s/sim-one/www.sim-one.ca/sites/all/modules/simone_forms/user-register-form.tpl.php' for inclusion (include_path='.:') in theme_render_template() (line 1495 of /u/s/sim-one/www.sim-one.ca/includes/theme.inc).

And this prevents me from creating users.

One thing I noticed is the error message says:

Warning: include(/u/s/sim-one/www.sim-one.ca/sites/all/modules/simone_forms/user-register-form.tpl.php): failed to open stream: No such file or directory in theme_render_template()

This is strange because :
/u/s/sim-one/www.sim-one.ca/sites/all/modules/simone_forms
is where my module file is located, but the tpl file it's referring to is actually here:
/u/s/sim-one/www.sim-one.ca/sites/all/themes/sim_one/templates

Any help in resolving this would be great - thanks

Comments

nevets’s picture

I am guessing sim_one is the theme for your site and you are using a different theme for administration. Since your template is associated with the theme and not the module, Drupal will not find it unless you add a copy to the administration theme (or associated the template with the module).

TimToronto’s picture

Thanks, that's correct, the module name is "sim_one". I'll give this a try - to associate a template with a module do I simple include it in the module folder?

TimToronto’s picture

I'm still having trouble figuring this out. It really isn't necessary to use the changes to the forms from the public theme in the administration theme, so I would like to just bypass the implementation of the hook if the current user is in the administration theme... i've been testing things out and thought if I wrapped it in this:

$testval = drupal_get_path('theme',$GLOBALS['theme']);
if ($testval == 'sites/all/themes/sim_one') { ....
}

But that doesn't seem to work, I keep getting an error message like this:

Fatal error: Unsupported operand types in /u/s/sim-one/www.sim-one.ca/includes/theme.inc on line 635

Any suggestions on how to achieve this? Thanks