Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

Help needed

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Help Wanted (commercial)
View previous topic :: View next topic  
Author Message
Smarty002
Smarty n00b


Joined: 08 Jun 2019
Posts: 4

PostPosted: Sat Jun 08, 2019 6:39 pm    Post subject: Help needed Reply with quote

Hi,

Been struggeling how to get smarty 3 to display the errors.

Code:
public static function muteExpectedErrors()
    {
        return Smarty_Internal_ErrorHandler::muteExpectedErrors();
    }


can someone help me, im seeing a blank page and want to know where the problem is so i can solve it.

thank you.
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Sun Jun 09, 2019 10:54 pm    Post subject: Reply with quote

A blank page because of a syntax error in Smarty code is not an expected error. So working with muteExpectedErrors() will probably not help you here.

I recommend that in your PHP code, you find where there may be an error handler and get that to tell PHP to display all errors, possibly to also log all errors to an error_log file somewhere.
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Mon Jun 10, 2019 5:15 am    Post subject: Reply with quote

Check your server error log.
If you want to see error in browser, set display_errors to 1 in your php.ini.
Back to top
View user's profile Send private message
Smarty002
Smarty n00b


Joined: 08 Jun 2019
Posts: 4

PostPosted: Thu Jun 13, 2019 2:17 pm    Post subject: Reply with quote

bsmither wrote:
A blank page because of a syntax error in Smarty code is not an expected error. So working with muteExpectedErrors() will probably not help you here.

I recommend that in your PHP code, you find where there may be an error handler and get that to tell PHP to display all errors, possibly to also log all errors to an error_log file somewhere.


I’m pretty sure its smarty that is not showing the errors. As error logging as error reporting are “on”. Example: i could make .php file and make a error into it and it would display the error but because the template is with smarty its shows blank page. Problem is with smarty not PHP

Can you as the sir who replied show me how to enable smarty error reporting.
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Thu Jun 13, 2019 2:59 pm    Post subject: Reply with quote

After you instantiate the Smarty class, try using:
Code:
$smartyObject->setErrorReporting(E_ALL);
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Fri Jun 14, 2019 9:19 pm    Post subject: Reply with quote

Quote:
php-bot: Set 'error_reporting' to -1 and 'display_errors' to 1 in your php.ini and be sure to restart your webserver/fastcgi-listeners. This is more reliable than using ini_set() and error_reporting() in the script, which will fail if there are parse errors. See http://php.net/errorfunc.configuration for more.
Back to top
View user's profile Send private message
Smarty002
Smarty n00b


Joined: 08 Jun 2019
Posts: 4

PostPosted: Thu Jun 20, 2019 5:44 am    Post subject: Reply with quote

bsmither wrote:
After you instantiate the Smarty class, try using:
Code:
$smartyObject->setErrorReporting(E_ALL);


Hi where should i put this code? I have insert this code on the page that displays the blank page, but still no error displayed.

AnrDaemon wrote:
Quote:
php-bot: Set 'error_reporting' to -1 and 'display_errors' to 1 in your php.ini and be sure to restart your webserver/fastcgi-listeners. This is more reliable than using ini_set() and error_reporting() in the script, which will fail if there are parse errors. See http://php.net/errorfunc.configuration for more.

Have also done this, and still blank page. Im pretty sure its not PHP but smarty that is not displaying errors.
Back to top
View user's profile Send private message
bsmither
Smarty Elite


Joined: 20 Dec 2011
Posts: 322
Location: West Coast

PostPosted: Thu Jun 20, 2019 5:14 pm    Post subject: Reply with quote

"Where should i put this code?"

Somewhere in your PHP code will be something like:
$smartyObject = new Smarty();

Add:
$smartyObject->setErrorReporting(E_ALL);
right after that.
Back to top
View user's profile Send private message
Smarty002
Smarty n00b


Joined: 08 Jun 2019
Posts: 4

PostPosted: Thu Jun 27, 2019 7:11 am    Post subject: Reply with quote

bsmither wrote:
"Where should i put this code?"

Somewhere in your PHP code will be something like:
$smartyObject = new Smarty();

Add:
$smartyObject->setErrorReporting(E_ALL);
right after that.

Well its now working but now i see a error that im not familiar with:
Code:
"Fatal error: Uncaught --> Smarty Compiler: Syntax error in template "file:/home/****/Website.nl/admin/admin/categories.tpl" on line 25 "<tr{cycle values=", class="cycle""}>" - Unexpected "cycle", expected one of: "}" <-- thrown in /home/****/website.nl/includes/smarty/sysplugins/smarty_internal_templatecompilerbase.php on line 25"


this is the code i have in my document on, but it should work? Was using smarty 2 previous but have upgraded it to smarty 3. Could it be that things changed?
Code:
<tr{cycle values=", class="cycle""}>


When i delete code everything works.. Hmm
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1785

PostPosted: Thu Jun 27, 2019 12:18 pm    Post subject: Reply with quote

You have broken quotation in there.
Code:
", class="cycle""
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Help Wanted (commercial) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP