Announcement

#1 2023-12-20 00:44:37

OpenPicture
Member
2023-12-19
44

[Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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

 

#2 2023-12-20 15:50:05

OpenPicture
Member
2023-12-19
44

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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

 

#3 2023-12-20 16:06:53

Katryne
Member
2016-12-03
372

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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.


http://photos.katrynou.fr/ v.14.1.0 https://album.chauvigne.info/ v.13.8.0
Système d'exploitation: Linux - Hébergeur 1&1-Ionos PHP: 8.0.28 - MySQL: 5.7.38
Bibliothèque graphique: External ImageMagick 6.9.10-23

Offline

 

#4 2023-12-20 17:59:51

OpenPicture
Member
2023-12-19
44

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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

 

#5 2023-12-20 18:50:40

Katryne
Member
2016-12-03
372

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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.


http://photos.katrynou.fr/ v.14.1.0 https://album.chauvigne.info/ v.13.8.0
Système d'exploitation: Linux - Hébergeur 1&1-Ionos PHP: 8.0.28 - MySQL: 5.7.38
Bibliothèque graphique: External ImageMagick 6.9.10-23

Offline

 

#6 2023-12-20 20:55:53

OpenPicture
Member
2023-12-19
44

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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

 

#7 2023-12-20 22:42:08

OHappyDay
Member
2023-02-08
65

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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

 

#8 2023-12-21 01:21:36

OpenPicture
Member
2023-12-19
44

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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

 

#9 2023-12-27 14:58:08

OpenPicture
Member
2023-12-19
44

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

Will there ever be an update for the Whois Online plugin?

Offline

 

#10 2023-12-29 16:12:23

OpenPicture
Member
2023-12-19
44

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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

 

#11 2024-01-24 21:34:15

OpenPicture
Member
2023-12-19
44

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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

 

#12 2024-01-25 05:54:01

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

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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.


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

 

#13 2024-01-25 10:23:47

OpenPicture
Member
2023-12-19
44

Re: [Plugin] Whois Online with Piwigo 14.0 and PHP 8.1

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

 

Board footer

Powered by FluxBB

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