Hello,
Whois Online activated with Piwigo 14.0 and PHP 8.1 is giving me a blank page with the following error:
PHP Fatal error: Uncaught mysqli_sql_exception: Data too long for column 'last_tag_ids' at row 1 in /include/dblayer/functions_mysqli.inc.php:132
Stack trace:
#0 /include/dblayer/functions_mysqli.inc.php(132): mysqli->query('REPLACE INTO ko...')
#1 /plugins/whois_online/include/wo_functions.inc.php(100): pwg_query('REPLACE INTO ko...')
#2 /plugins/whois_online/online.php(266): whois_online_update(Array, Array, 2)
#3 /include/functions_plugins.inc.php(264): whois_online_management()
#4 /picture.php(137): trigger_notify('loc_begin_pictu...')
#5 {main}
thrown in /include/dblayer/functions_mysqli.inc.php on line 132
On line 132 I have ($result = $mysqli->query($query)) or my_error($query, $conf['die_on_sql_error']);
The error message indicates that there is an attempt to insert or update data into the 'last_tag_ids' column in the database, and the data being provided is too long for the column's defined length.
"Data too long for column" occurs when you try to insert or update a value that exceeds the maximum length allowed for that column.
Why does it work in PHP 7.4 and not in PHP 8.1 ?
Offline
Is this error caused because of the Bootstrap Darkroom theme or does anyone have this problem with other themes as well?
I tried uninstalling and reinstalling, but after a while of use, the blank page and errors reappear.
Does anyone have any idea about this problem?
Offline
I use Whois online with Piwigo 14 and Php 8.1 and BootstrapDarkroom. It's "just" the radar report tab in admin that is out of service. The 2 other settings tab are OK and so is the public page display. As I hide error display with Local File Editor, I am not disturbed very much, since I never use the radar tab.
Offline
Hello Katryne,
Thank you very much for your response.
Now I know that the problem is not necessarily related to the Bootstrap Darkroom theme.
If I hide the display of errors on my site, I unfortunately still have my log file, which in 1 hour can take up several Megabytes of space.
What still surprises me is that with Whois Online, I have a fatal error which displays a blank page instead of displaying my site. And this only happens under PHP 8.1 with Piwigo 14.0. With PHP 7.4, I have no errors displayed or written to the PHP error log file.
This is the first update that has caused me so many problems since I started using Piwigo many years ago.
Offline
I remember something that happened some years ago : when visitors began to comme with IPv6 instead of IPv4, it caused a problem because the IP were too long and my son had to modify the MySQL tables so that they accept longer IP. I do not think it was with a Piwigo.
Offline
I noticed, that Piwigo is still connecting to the MySQLi database with utf8mb3 instead of using utf8mb4.
The utf8mb4 character set supports a wider range of characters, including emoji and other supplementary characters, compared to utf8mb3. Emoji icons used in comments result in the comment not appearing at all, not even on the admin side of Piwigo. Users often complain that when they made a comment using Apple icons or other emojis, they did it in vain, because they lost what they have written.
I don't even know if one can change Piwigo's database from utf8mb3 to utf8mb4 without crashing the database?
I still don't know why Whois Online is working in PHP 7.4 and not in PHP 8.1.
Maybe that the Piwigo support team can explain why?
Offline
Check with your hoster (or yourself if you have access to the MySQL instance) whether it has been setup with utf8mb4 or utf8mb3.
My hoster uses already utf8mb4 by default (assuming that the database setup is handled by them and not by Piwigo)
Last edited by OHappyDay (2023-12-20 22:48:46)
Offline
Hi OHappyDay,
Thanks a lot for your response.
On my server I have other Websites where the database is configured to utf8mb4_unicode_ci or even utf8mb4_0900_ai_ci, which means, that my hoster offers also utf8mb4.
Piwigo sets in functions_mysqli.inc.php $db_charset = 'utf8'; :
"* Set charset for database connection. */
function pwg_db_check_charset()
{
global $mysqli;
$db_charset = 'utf8';
if (defined('DB_CHARSET') and DB_CHARSET != '')
{
$db_charset = DB_CHARSET;
}
$mysqli->set_charset($db_charset);
}".
I could now set $db_charset = 'utf8mb4';, but this will only affect the character set used for the connection itself. It does not automatically alter the character set of your existing database tables or columns.
To change the character set of an existing tables and columns to 'utf8mb4', I would need to run specific SQL queries to modify each table and column individually. Like for example:
"-- Change the character set of a table
ALTER TABLE your_table CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
-- Change the character set of a column
ALTER TABLE your_table MODIFY your_column VARCHAR(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
".
For a reason that I do not understand, Piwigo's character is set to utf8mb3_general_ci.
Maybe that Pierrick Le Gall (plg) could give us a hint?
Offline
Will there ever be an update for the Whois Online plugin?
Offline
Same problem with Piwigo 14.1, I have to switch it off, otherwise I get :
PHP Fatal error: Uncaught mysqli_sql_exception: Data too long for column 'last_sch_ids' at row 1 in /include/dblayer/functions_mysqli.inc.php:132
Stack trace:
#0 /include/dblayer/functions_mysqli.inc.php(132): mysqli->query('REPLACE INTO ko...')
#1 /plugins/whois_online/include/wo_functions.inc.php(100): pwg_query('REPLACE INTO ko...')
#2 /plugins/whois_online/online.php(266): whois_online_update(Array, Array, 2)
#3 /include/functions_plugins.inc.php(264): whois_online_management()
#4 /index.php(28): trigger_notify('loc_begin_index')
#5 {main}
thrown in /include/dblayer/functions_mysqli.inc.php on line 132
Environment
Piwigo 14.1.0 Check for upgrade
Installed on 26 November 2016, 7 years 1 month 3 days ago
Operating system: Linux
PHP: 8.1.26 (Show info) [2023-12-29 14:33:28]
MySQL: 8.0.35-cll-lve [2023-12-30 03:33:28]
Graphics Library: ImageMagick 6.9.12-93
Cache size 1734.46 Mo calculated 10 seconds ago Refresh
Activated plugin list 31
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
PWG Stuffs (gives an error even with Piwigo 14.1)
Rotate Image
RV Thumb Scroller
SmartAlbums
Smilies Support
Stop Spammers
user delete photo
User Tags
Offline
I had to switch off the plugin otherwise with Piwigo 14.1 and PHP 8.1 I am getting so many errors per minute, that I had to add to my .htaccess file the following command php_flag log_errors Off, otherwise I would have had log files with hundreds of Megabytes.
As nobody reacted to this here, I'll ask the question again?
Will there ever be an update for the Whois Online plugin?
Offline
Hi :-)
OpenPicture wrote:
Will there ever be an update for the Whois Online plugin?
There will be an update, but I don't know when.
Offline
Hi ddtddt,
Thank you very much for your response, it's already really good to know that there will be an update at all.
Offline