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
Does anyone else have this error with the footer?
Offline
Hi,
error in bootstrap
what option are you select for reproduce this ?
Offline
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
Hi ddtddt,
Was this the information that You wanted and what You meant with "what option are you select for reproduce this ?"
Offline
The footer file wasn't changed in Piwigo 14.1.
Offline
Hi :-)
you're update Bootstrap theme ?
Offline
Hi ddtddt,
My theme is Theme: Bootstrap Darkroom 2.5.18 with Color theme Bootswatch Cyborg and Custom CSS.
Offline