I have had been doing same with previous smarty versions... Like loading a TPL file outside of specified templates folder, like this:
$smarty->display("../admin/bin/tpl/default.tpl");
exit();
however since upgrade, I receive following errors:
[12-Jun-2013 11:40:12 UTC] PHP Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file '../admin/bin/header.tpl' in '../admin/bin/tpl/default.tpl'' in
Have you tried an absolute path? i.e.
$smarty->display("/var/www/mywebsite.com/templates/admin/bin/tpl/default.tpl");
That should work according to the manual (and it does for me)
Related
I am working on an old WordPress site. Although the site is updated to the latest version of WordPress (5.9.1) it was apparently built on the twentyfouteeen theme.
Just lately, I am getting a fatal error on the Posts Page:
Fatal error: Uncaught Error: Call to undefined function twentyfourteen_categorized_blog()
The function is located in the template-tags.php file and it exists so the theme should be able to access it. In fact, I'm getting the fatal error on any page that calls a twentyfourteen function.
I copied the functions from template-tags.php to content.php which did in fact load posts but then gave me a different error Cannot redeclare twentyfourteen_categorized_blog()
I've never had to troubleshoot this kind of error and since the theme is old, I'm not sure how to go about it.
"Cannot redeclare twentyfourteen_categorized_blog()" means that your file is trying to declare the same function multiple times. Either the function is defined in two separate files or in two places in the same file.
I was able to resolve this by including template_tags.php in functions.php
I have a wordpress install and when I click to edit a post/page to edit I get this error:
Fatal error: Uncaught Error: Class 'WP_REST_Application_Passwords_Controller' not found
in /Users/kawnah/Sites/website/wp-includes/rest-api.php on line 269
Call stack:
create_initial_rest_routes()
wp-includes/class-wp-hook.php:287
WP_Hook::apply_filters()
wp-includes/class-wp-hook.php:311
WP_Hook::do_action()
wp-includes/plugin.php:484
do_action()
wp-includes/rest-api.php:521
rest_get_server()
wp-includes/rest-api.php:479
rest_do_request()
wp-includes/rest-api.php:2520
rest_preload_api_request()
array_reduce()
wp-admin/edit-form-blocks.php:82
require()
wp-admin/post.php:187
I went ahead and navigated to the file referenced and see:
And when I navigate to the actual class it is present:
My version of Wordpress is 5.6.2 - when I disable all plugins I get a TON of errors:
How do you even go about debugging this? What is the fix for this if any?
If anyone stumbles on this - what fixed this is downloading fresh core Wordpress (https://wordpress.org/download/) and replacing everything except wp-content directory to preserve your theme changes etc.
I am new to wordpress and creating a plugin, an error log has been created automatically in my plugins templates folder which listed so many errors saying -
[22-Dec-2015 07:57:25 Etc/GMT] PHP Fatal error: Call to undefined
function wp_redirect() in
/home/techgwpj/public_html/www.hostrecyclers.com/WP/doctor/wp-content/plugins/tg-doctorin/templates/user-activation.php
on line 12.
When I was doing the same thing from my themes/templates folder this was working fine, but as soon as i placed the same code into my plugins/templates folder it stopped working and a blank page appeared and all the wp functions became undefined
i.e. wp_redirect, get_header(), get_footer() etc
In prestashop it show blank page both side fron end and backend some time show following error:
[PrestaShop] Fatal error in module smarty_internal_write_file:
Uncaught --> Smarty: unable to write file D:\Hosting\11513307\html\Shop/cache/smarty/compile\50\d0\37\wrt547ffab5121125_65960237
<-- thrown
Your Smarty Cache directory either does not exist or it does not have write permissions.
please provide write permission to the directory.
D:\Hosting\11513307\html\Shop/cache/smarty/compile\50\d0\37\
While working with PHPExcel in my application I got following errors
In PHPExcel/Autoloader.php file for line “PHPExcel_Shared_ZipStreamWrapper::register();”,
Fatal error: require() [function.require]: Failed opening required '/wamp/www/xxxx/site//common/class/PHPExcel_Shared_ZipStreamWrapper.class.php' (include_path='C:\wamp\www\xxxx\site\common\html_purifier;.;C:\php\pear') in C:\wamp\www\xxxx\site\config\bootstrap.php on line 27
and for line “PHPExcel_Shared_String::buildCharacterSets();”
Fatal error: require() [function.require]: Failed opening required '/wamp/www/xxxx/site//common/class/PHPExcel_Shared_String.class.php' (include_path='C:\wamp\www\xxxx\site\common\html_purifier;.;C:\php\pear') in C:\wamp\www\xxxx\site\config\bootstrap.php on line 27
I'm using wamp with php 5.3.5. and zip xml and gd2 extensions are enable on my local machine.
Please help me for this.
Thanks.
The reference to C:\wamp\www\xxxx\site\config\bootstrap.php suggests you're working with some kind of framework: does it have an autoloader that could be conflicting with or overriding PHPExcel's autoloader?
The reference to
'/wamp/www/xxxx/site//common/class/PHPExcel_Shared_ZipStreamWrapper.class.php'
seems to confirm this.
as something is changing the filename to include ".class" as part of the filename, and it's ignoring PHPExcel's own autoloader that splits a class name to match its directory structure
If you're using a standard framework such as ZF or Symfony, then you should register PHPExcel with that framework. If it's a homebrew, make sure your autoloader is SPL registered
You seem to be having double slashes in your path:
/wamp/www/xxxx/site*//*common
So it's probably a path issue and the autoloader isn't able to load the file because the path is wrong.