Announcement

#1 2024-03-31 13:24:28

aanimeri
Member
2018-04-10
15

Error message appears above comments

Hello

this error message appears above comments

/var/www/vhosts/aanimeri.fi/httpdocs/piwigo/_data/templates_c/sx271o^d6e90be4c55b6a4eecd017c4fc4d95149e4d8fb9_0.file.comment_list.tpl.php on line 92
d41d8cd98f00b204e9800998ecf8427e?d=https://www.aanimeri.fi//piwigo/themes/bootstrap_darkroom/img/user.png" />

Piwigo 14.3.0
Installed on 26 March 2018, 6 years 4 days ago
Operating system: Linux
PHP: 8.1.27 (Show info) [2024-03-31 11:12:41]
MySQL: 10.3.39-MariaDB-0+deb10u2 [2024-03-31 14:12:41]
Graphics Library: ImageMagick 6.9.10-23
Cache size N/A   never calculated Refresh
Bootstrap Darkroom 2.5.21

Piwigo URL: https://www.aanimeri.fi/piwigo

If logging into the Piwigo application this error message does not appear.

If something must be changed please advise the directory and name of the file. I do not feel very comfortable editing system files.

With easter greetings regards Timo Sylvänne

Offline

 

#2 2024-03-31 19:57:14

OHappyDay
Member
2023-02-08
64

Re: Error message appears above comments

I tested this but here comments are displayed without an error message.

The file you mention contains this code at line 92:

<img class="gravatar" src="//www.gravatar.com/avatar/<?php echo md5(strtolower(trim($_smarty_tpl->tpl_vars['comment']->value['EMAIL'])));?>

The error message you can see seems to indicate that there is a problem with HTML syntax produced by that template file.

When I look into the source code of your website I can see a bit more of the error message. It seems that the EMAIL value is undefined.
Can you check whether you have defined an email contact in Piwigo?


<b>Warning</b>:  Undefined array key "EMAIL" in <b>/var/www/vhosts/aanimeri.fi/httpdocs/piwigo/_data/templates_c/sx271o^d6e90be4c55b6a4eecd017c4fc4d95149e4d8fb9_0.file.comment_list.tpl.php</b> on line <b>92</b><br />
d41d8cd98f00b204e9800998ecf8427e?d=https://www.aanimeri.fi//piwigo/themes/bootstrap_darkroom/img/user.png" />

Last edited by OHappyDay (2024-03-31 20:00:38)

Offline

 

#3 2024-04-01 11:54:55

aanimeri
Member
2018-04-10
15

Re: Error message appears above comments

Thank you very much for your help.

If you mean by "email contact in Piwigo"  shown on the bottom of every Piwigo page "Powered by Piwigo | Contact webmaster" I can see "contact webmaster" only if logged in. If I am not logged in browsing as a guest I see only "Powered by Piwigo". Not "Contact webmaster"

I guess "Powered by Piwigo | Contact webmaster" email address comes from webmaster's user settings. For guest user  I have not found a chance for email definition.

What is the directory and file name where you found code  for www.gravatar.com/avatar/?

I have tested Firefox, Edge, Vivaldi and Opera browsers and all show same error message for all of the 4170 comments when browsing as a guest.

Offline

 

#4 2024-04-01 12:44:39

erAck
Only trying to help
2015-09-06
2038

Re: Error message appears above comments

That is not about the site's email contact in Piwigo, but the comment author's email. The Bootstrap Default theme tries to fetch the corresponding avatar image, but does not check whether email is actually set, see themes/bootstrapdefault/template/comment_list.tpl line 34.

You could either fiddle with that theme code to pull the gravatar image only if email is set, i.e. by replacing

Code:

            <img class="gravatar" src="//www.gravatar.com/avatar/{$comment.EMAIL|trim|strtolower|md5}?d={$http_scheme}://{$smarty.server.HTTP_HOST}/{$ROOT_URL}themes/bootstrapdefault/img/user.png" />

with something like

Code:

            <img class="gravatar" src="{if isset($comment.EMAIL)}//www.gravatar.com/avatar/{$comment.EMAIL|trim|strtolower|md5}?d={$http_scheme}://{$smarty.server.HTTP_HOST}/{/fi}{$ROOT_URL}themes/bootstrapdefault/img/user.png" />

(untested!)

or suppress PHP messages altogether, i.e. in local config have

$conf['show_php_errors_on_frontend'] = false;

or fine tune message classes to display, see [Forum, post 183126 by erAck in topic 31852] Menubar tags issue after 12.2.0 upgrade, or better, log to file instead.
See [Forum, post 180778 by erAck in topic 31258] Error Message.


Running Piwigo at https://erack.net/gallery/

Offline

 

#5 2024-04-02 12:38:52

aanimeri
Member
2018-04-10
15

Re: Error message appears above comments

OHappyDay and erAck, thank you very much for help. My problem is now solved.

With some curious investigation I learned what means "Local Config" and using LocalFilesEditor added rows:

$conf['show_php_errors'] = E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_WARNING;
$conf['show_php_errors_on_frontend'] = false;

The first row prevents PHP error messages from comments and the second one solved the problem I described in my opening message. A comment of one row is much easier to read when there are not five lines of error messages above.

Might somebody have a piece of advise how to get visible webmaster's email link on the bottom of each Piwigo page?

Powered by Piwigo | Contact webmaster

"Contact webmaster" is seen when logged in. Without loggin browsing as a guest user "Contact webmaster" is not seen. Only Powered by Piwigo.

Thank you

Offline

 

Board footer

Powered by FluxBB

github twitter newsletter Donate Piwigo.org © 2002-2024 · Contact