Page 1 of 1

Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Sun Apr 11, 2021 5:50 pm
by freymann
On a fresh install of v2.3.5 with default back end and a customized front end, everything appears to be working just fine.

But in the web server's error_log file I am seeing:

Fatal Error: Uncaught --> Smarty: Source: Missing name thrown in ../bundled-libs/Smarty/libs/sysplugins/smarty_template_source.php on line 168

I've obviously done some searching on this, and it would appear it is something in a template that calling up something not defined?

We only have config.inc.php, entries_archives.tpl, entries.tpl, feed_2.0.tpl and index.tpl

I inherited this theme and have cleaned it up to v2.3.5 specs as best I can after reviewing the online docs and making required updates.

The entire site appears to be loading, I don't see any missing content, but there's this Fatal Error in the logs that is driving me crazy LOL

Is there any way to determine what file has this missing name?

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Sun Apr 11, 2021 6:54 pm
by onli
The strange thing is that a fatal error should also be visible in the blog itself, by producing a 500 error. Maybe it only happens when visiting seldom opened pages, like the 404 page?

The only idea I have right now to test it: Add

Code: Select all

$serendipity['production'] = 'debug';
to your serendipity_config_local.inc.php. Maybe that way while going through the pages in the blog an error message will appear.

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Sun Apr 11, 2021 8:37 pm
by freymann
With this line in the local config file: $serendipity['production'] = 'debug';

[Sun Apr 11 13:32:32.614968 2021] [php7:error] [pid 69474] [client 66.249.70.81:44301] PHP Fatal error: Uncaught --> Smarty: Source: Missing name <-- \n thrown in /public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_source.php on line 168

[Sun Apr 11 13:32:32.615132 2021] [php7:error] [pid 69474] [client 66.249.70.81:44301] PHP Fatal error: Uncaught ErrorException: Fatal Error: Uncaught --> Smarty: Source: Missing name <-- \n thrown in /public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_source.php:168\nStack trace:\n#0 /public_html/blog/include/compat.inc.php(254): errorToExceptionHandler()\n#1 [internal function]: fatalErrorShutdownHandler()\n#2 {main}\n thrown in /public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_source.php on line 168

I moved around the site, viewed categories, the main page and individual articles. I don't see anything wrong with the output to the screen at all.

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Sun Apr 11, 2021 8:48 pm
by freymann
That IP # in the error log is a googlebot.com address.

I looked in the error log for the IP# I was coming from and there are no errors, so the google bot must be checking on different urls.

A quick search in the access_log is showing the bots hitting comment.php, so it's something to do with the comments, which I did import from the old version but have never looked for any or clicked on a comment link yet.

We don't even have a coments.tpl file, should we?

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Sun Apr 11, 2021 9:53 pm
by onli
The theme should fall back to the 2k11's file, you do not need to have a specific one in the theme.

The comment.php has not that many calls to Smarty. You could try them out - and just try to comment. The log does not contain the GET parameters, does it?

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Sun Apr 11, 2021 10:39 pm
by freymann
Yes it does...

== ERROR-REPORT (DEBUGGING ENABLED) ==
== (When you copy this debug output to a forum or other places, make sure to remove your username/passwords, as they may be contained within function calls) ==
#0 errorToExceptionHandler(1, Uncaught --> Smarty: Source: Missing name <--
thrown, /public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_source.php, 168) called at [/public_html/blog/include/compat.inc.php:254]
#1 fatalErrorShutdownHandler()
Fatal Error: Uncaught --> Smarty: Source: Missing name <-- thrown in /public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_source.php on line 168.

And like magic I have a page with the error, but it's still not telling me anything more than what is in the error_log file.

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Sun Apr 11, 2021 10:42 pm
by freymann
/blog/comment.php?serendipity[entry_id]=2813&serendipity[type]=comments

The web url is calling on entry id 2813.
When I call that one up in the database it says there aren't any comments.
And if I look in the comments table there are no matches.
Is this a bug when an entry has no comments?

If I load up the entry directly

/archives/2813-blank.html (I just used anything for the html, I was just trying to force up 2813)

It loads properly and the comment form is below. It says 0 comments.

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Mon Apr 12, 2021 4:57 pm
by onli
And if you visit yoururl/blog/comment.php?serendipity[entry_id]=2813&serendipity[type]=comments directly, do you get a blank page?

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Tue Apr 13, 2021 1:20 am
by freymann
no blank page, I get this:

== ERROR-REPORT (DEBUGGING ENABLED) ==
== (When you copy this debug output to a forum or other places, make sure to remove your username/passwords, as they may be contained within function calls) ==
#0 errorToExceptionHandler(1, Uncaught --> Smarty: Source: Missing name <--
thrown, public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_source.php, 168) called at [/public_html/blog/include/compat.inc.php:254]
#1 fatalErrorShutdownHandler()
Fatal Error: Uncaught --> Smarty: Source: Missing name <-- thrown in /public_html/blog/bundled-libs/Smarty/libs/sysplugins/smarty_template_source.php on line 168.

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Tue Apr 13, 2021 4:45 pm
by onli
Well, that's at least a hint.

In that PHP file comment.php, one of the last lines is this:

Code: Select all

$serendipity['smarty']->display(serendipity_getTemplateFile($serendipity['smarty_file'], 'serendipityPath'));
That's line 230 at my test installation, which I think is unchanged. Add a debug output there:

Code: Select all

echo "debugging test";
print_r($serendipity['smarty_file']);
$serendipity['smarty']->display(serendipity_getTemplateFile($serendipity['smarty_file'], 'serendipityPath'));
Is that then shown when you visit that page?

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Tue Apr 13, 2021 5:09 pm
by freymann
Very nice,

commentpopup.tpl

is what gets returned.

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Tue Apr 13, 2021 8:06 pm
by onli
Which is very strange. That is what I'd expect to be empty, given the error message. You could try to place a commentpopup.tpl from 2k11 or from default into your theme.

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Wed Apr 14, 2021 1:03 am
by freymann
Nice! That gets rid of the error but at the same time I have comments disabled in the Spam Plugin so the comment form shouldn't be coming up at all.

I guess I can just edit the tpl file and remove the form, as we don't want new comments at this time.

Re: Fatal Error: Uncaught --> Smarty: Source: Missing name

Posted: Tue Oct 19, 2021 7:39 pm
by rossjulie
ErrorException: Fatal Error: Uncaught --> Smarty: Source: Missing name___
Happens mostly on googlebots