#1 2023-12-19 16:18:22

OpenPicture
Member
2023-12-19
57

PHP Deprecated in footer.tpl

Hello,

I have the following error message:

PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /_data/templates_c/rn5uyt^75ce9b74fffafd9b7afefae5e6ef25797e00c942_0.file.footer.tpl.php on line 83

The deprecation warning is likely related to the preg_match line in the footer.tpl file.
The warning suggests that $theme_config->bootstrap_theme might be null at some point, leading to the deprecation notice. To resolve this, I modified the code to check if $theme_config->bootstrap_theme is not null before using it in preg_match.
Therefore, in the footer I replaced:
{if preg_match('/^material/', $theme_config->bootstrap_theme)}
    {footer_script require='bootstrap'}
    $('body').bootstrapMaterialDesign();
    {/footer_script}
{/if}
with the following code:
{if isset($theme_config->bootstrap_theme) && preg_match('/^material/', $theme_config->bootstrap_theme)}
    {footer_script require='bootstrap'}
    $('body').bootstrapMaterialDesign();
    {/footer_script}
{/if}
The error disappeared in my PHP error log.

Have a nice day,
OpenPicture

Offline

 

#2 2023-12-20 15:53:55

OpenPicture
Member
2023-12-19
57

Re: PHP Deprecated in footer.tpl

Does anyone else have this error with the footer?

Offline

 

#3 2023-12-21 07:02:32

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7340

Re: PHP Deprecated in footer.tpl

Hi,

error in bootstrap

what option are you select for reproduce this ?


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#4 2023-12-21 15:57:43

OpenPicture
Member
2023-12-19
57

Re: PHP Deprecated in footer.tpl

Hi ddtddt,

I replaced in </> Templates the original footer.tpl with a modified my_footer.tpl.

Here is my piwigo setup:

Environment
Piwigo 14.0.0 Check for upgrade
Installed on 26 November 2016, 7 years 3 weeks 2 days ago
Operating system: Linux
PHP: 8.1.26 (Show info) [2023-12-19 14:35:36]
MySQL: 8.0.35-cll-lve [2023-12-20 03:35:36]
Graphics Library: ImageMagick 6.9.12-93
Cache size 1733.47 Mo

Theme: Bootstrap Darkroom 2.5.18

Activated plugins (that give no PHP 8.1 errors)
Add < head > element
Additional Pages
Advanced Menu Manager
Change who added photo
Community
Crypto Captcha
Edit Filename
Embedded Videos
Extended Description
Grum Plugins Classes.3
GThumb+
Header Manager
Language Switch
LocalFiles Editor
Media Icon
Meta Open Graph
Most Commented
Permalink Generator
Perso Footer
Personal Favicon
Personal Plugin
Photo Update
Posted Date Changer
Rotate Image
RV Thumb Scroller
Smilies Support
Stop Spammers
Update Album
user delete photo

Deactivated plugins (that give PHP 8.1 errors)
Charlie's content 3.5
Check Uploads
PWG Stuffs
SmartAlbums
Thumbnail Tooltip
URL Uploader
User Tags
Whois online (produces blank page)

Offline

 

#5 2023-12-22 15:07:36

OpenPicture
Member
2023-12-19
57

Re: PHP Deprecated in footer.tpl

Hi ddtddt,

Was this the information that You wanted and what You meant with "what option are you select for reproduce this ?"

Offline

 

#6 2023-12-29 16:25:29

OpenPicture
Member
2023-12-19
57

Re: PHP Deprecated in footer.tpl

The footer file wasn't changed in Piwigo 14.1.

Offline

 

#7 2023-12-30 06:19:40

ddtddt
Piwigo Team
Quetigny - France
2007-07-27
7340

Re: PHP Deprecated in footer.tpl

Hi :-)

you're update Bootstrap theme ?


You love Piwigo so don't hesitate to participate, learn more on the "Contribute to Piwigo" page. If you don't have much time for contribution, you can also help the project with a donation.

Offline

 

#8 2023-12-30 15:18:18

OpenPicture
Member
2023-12-19
57

Re: PHP Deprecated in footer.tpl

Hi ddtddt,

My theme is Theme: Bootstrap Darkroom 2.5.18 with Color theme Bootswatch Cyborg and Custom CSS.

Offline

 

Board footer

Powered by FluxBB