i3theme with 2.4.0 and PHP8.0 - a problem I have

Skinning and designing Serendipity (CSS, HTML, Smarty)
Post Reply
DF9CY
Regular
Posts: 5
Joined: Thu Oct 15, 2015 7:31 pm

i3theme with 2.4.0 and PHP8.0 - a problem I have

Post by DF9CY »

Hi Friends,
Yesterday I successfully installed Version 2.4.0 on PHP7.4 and reconnected to my database. Everything went flawlessly and I could not see any error. After checking all functions I need, I switched to PHP8.0 (IONOS Server). I was pleased seeing the page coming up.
BUT there seems to be an error concerning the i3theme that I use and obviously would like to keep living.

Every blogentry I have in there has two Warnings like:
Warning: Undefined array key "has_comments" in /homepages/5/....../htdocs/serendipity/templates_c/i3theme/c4/86/9d/c4869da5469820d8f021f95650cb2ce976ad47b8_0.file.entries.tpl.php on line 72
and
Warning: Undefined array key "is_entry_owner" in /homepages/5/....../htdocs/serendipity/templates_c/i3theme/c4/86/9d/c4869da5469820d8f021f95650cb2ce976ad47b8_0.file.entries.tpl.php on line 131
Found the following by "onli" :

Code: Select all

$serendipity['production'] = true;
for adding into serendipity_config_local.inc.php, but this did not help

May be it's a simple thing, but I like some help here.
Perhaps you may look here: https://www.df9cy.de/serendipity/

Thanks in advance and a Merry Christmas
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: i3theme with 2.4.0 and PHP8.0 - a problem I have

Post by onli »

It seems to be still unclear why the production setting works for some, but not for others :/

You could fix those errors in the theme. You would need to edit the templates/i3theme/entries.tpl and change on line 16:

Code: Select all

<span class="comments">{if $entry.has_comments}{if $use_popups}<a href="{$entry.link_popup_comments}" onclick="window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;">{if $entry.comments == 0}{$CONST.NO_COMMENTS}{else}{$entry.comments} {$entry.label_comments}{/if}&nbsp;&raquo;</a>{else}<a href="{$entry.link}#comments">{if $entry.comments == 0}{$CONST.NO_COMMENTS}{else}{$entry.comments} {$entry.label_comments}{/if}&nbsp;&raquo;</a>{/if}{/if}</span>
to

Code: Select all

<span class="comments">{if 'has_comments'|array_key_exists:$entry and $entry.has_comments}{if $use_popups}<a href="{$entry.link_popup_comments}" onclick="window.open(this.href, 'comments', 'width=480,height=480,scrollbars=yes'); return false;">{if $entry.comments == 0}{$CONST.NO_COMMENTS}{else}{$entry.comments} {$entry.label_comments}{/if}&nbsp;&raquo;</a>{else}<a href="{$entry.link}#comments">{if $entry.comments == 0}{$CONST.NO_COMMENTS}{else}{$entry.comments} {$entry.label_comments}{/if}&nbsp;&raquo;</a>{/if}{/if}</span>
on line 42

Code: Select all

{if $entry.is_entry_owner and not $is_preview}&bull; <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>{/if}
to

Code: Select all

{if 'is_entry_owner'|array_key_exists:$entry and $entry.is_entry_owner and not $is_preview}&bull; <a href="{$entry.link_edit}">{$CONST.EDIT_ENTRY}</a>{/if}
and on line 97

Code: Select all

{if $entry.is_entry_owner}
to

Code: Select all

{if 'is_entry_owner'|array_key_exists:$entry and $entry.is_entry_owner}
You see the pattern :)

This is a temporary situation, it's likely the next bigger serendipity update with an updated smarty version will avoid these warnings completely where they currently get triggered in templates.
DF9CY
Regular
Posts: 5
Joined: Thu Oct 15, 2015 7:31 pm

Re: i3theme with 2.4.0 and PHP8.0 - a problem solved

Post by DF9CY »

Thank you, "onli", that's it. Working flawlessly with PHP8.0
Have a good time and Happy New Year 2023.
onli
Regular
Posts: 2825
Joined: Tue Sep 09, 2008 10:04 pm
Contact:

Re: i3theme with 2.4.0 and PHP8.0 - a problem I have

Post by onli »

Happy new year too!
Post Reply