Announcement

#1 2023-01-30 21:00:38

romanf
Member
2017-01-22
40

Smarty and PHP 8.2 -> broken

Hi everybody!

As PHP 7 is no longer supported, full support of PHP 8.x is desperatly required.

Is there anybody out there who can fix the Smarty issues with little effort?

--------
This template:

<script type="text/javascript">
var MRP_Opt={
  showName:"{$data.showname}",
  showComment:"{$data.showcomment}",
  pictures:[
{foreach from=$data.pictures item=picture name=items}
[...]
{/foreach}
  ]
};
var MRP_blockHeight={$data.blockHeight};
var MRP_delay={$data.delay};
</script>

----------
produces this:

<script type="text/javascript">
var MRP_Opt={
  showName:"<br />
<b>Warning</b>:  Undefined array key "showname" in <b>/[...]c96ef5_0.file.menu_random_photo.js.tpl.php</b> on line <b>28</b><br />
",
  showComment:"<br />
<b>Warning</b>:  Undefined array key "showcomment" in <b>/[...]c96ef5_0.file.menu_random_photo.js.tpl.php</b> on line <b>30</b><br />
",
  pictures:[
    {
[...]

--------

Seems like somewhere in Smarty some (now mandatory) checks for empty values is missing...

Any pointers as to where/what to fix?

Thanks
Roman

Offline

 

#2 2023-01-30 21:12:36

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13644

Re: Smarty and PHP 8.2 -> broken

Hi romanf,

romanf wrote:

As PHP 7 is no longer supported, full support of PHP 8.x is desperatly required.

Don't panic :-) Here we use Debian as Linux distribution on our servers. The current stable version of Debian (version 11) packages PHP 7.4. Not 8.0 or 8.1 or 8.2. Running to be immediately compatible with the latest version of PHP is sometimes complicated.

romanf wrote:

Is there anybody out there who can fix the Smarty issues with little effort?

To be compatible with PHP 8.2 we would need to update Smarty to version 4.3. Unfortunately, it comes with some risks. I absolutely don't want to make Piwigo 13 unstable to be compatible with PHP 8.2 while it works fine with PHP 8.1.

For now, unless someone can change my mind, I plan to have Smarty updated for Piwigo 14, which is currently under development.

Offline

 

#3 2023-01-31 06:23:22

romanf
Member
2017-01-22
40

Re: Smarty and PHP 8.2 -> broken

Dear Plg,

I completely understand your position.
I updated to php 8.x on my server because 7.x doesn't even receive security fixes anymore. And that's a risk I just didn't want to take. :-\

https://www.php.net/supported-versions.php

So, I hope that the smarty upgrade comes soon!

Thanks
Roman

Offline

 

#4 2023-01-31 12:50:22

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13644

Re: Smarty and PHP 8.2 -> broken

Do you think package maintainers at Debian don't backport security patches on PHP 7.4 ? (spoiler : they do keep packages secure)

Offline

 

#5 2023-01-31 13:06:32

romanf
Member
2017-01-22
40

Re: Smarty and PHP 8.2 -> broken

Ok, I wasn't aware of that.
However, it would be kind of overkill for me to switch distro on my server just to continue using PHP 7... :-\

;)
Roman

Offline

 

#6 2023-01-31 13:13:42

plg
Piwigo Team
Nantes, France, Europe
2002-04-05
13644

Re: Smarty and PHP 8.2 -> broken

That's actually the same for all Linux Distributions doing their job right :-)

Offline

 

#7 2023-01-31 16:03:39

Phil35
Member
France
2022-10-11
37

Re: Smarty and PHP 8.2 -> broken

good to know.

The important thing to know will be the date when you @plg and piwigo team will move from PHP 7.4 to PHP8.0 or PHP8.1 or PHP 8.2
This is the date when we will must move  too
Tks

Last edited by Phil35 (2023-01-31 16:04:45)

Offline

 

Board footer

Powered by FluxBB

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