Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #7874 - Unable to use custom _head.tpl file (alternative fix) #8053

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions include/Sugar_Smarty.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,17 @@ public function fetch($resource_name, $cache_id = null, $compile_id = null, $dis
return $fetch;
}

/**
* called for included templates
* @param string $_smarty_include_tpl_file
* @param string $_smarty_include_vars
*/
function _smarty_include($params)
{
$params['smarty_include_tpl_file'] = get_custom_file_if_exists($params['smarty_include_tpl_file']);
parent::_smarty_include($params);
}

/**
* Log smarty error out to default log location
* @param string $error_msg
Expand Down
6 changes: 1 addition & 5 deletions themes/SuiteP/tpls/header.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,7 @@
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
*}
{if file_exists('custom/themes/SuiteP/tpls/_head.tpl')}
{include file="custom/themes/SuiteP/tpls/_head.tpl"}
{else}
{include file="themes/SuiteP/tpls/_head.tpl"}
{/if}
{include file="themes/SuiteP/tpls/_head.tpl"}
<body onMouseOut="closeMenus();">

{if $AUTHENTICATED}
Expand Down