Bastien Durel
Forum Replies Created
-
I’ve fixed the problem on my side by running
ALTER TABLE wp_em_* CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci
on every table, but it would be better if they can be create correctly (and migrated otherwise)But it fails. When I put the tree in text, I get the error, if I remove it, the event can be created :/
post_content is created as
longtext
withutf8mb3_general_ci
The version from 7 years ago introduced
em_check_utf8mb4_tables
, which does not seems to have changed ever since. Maybe it should be updated to handle utf8mb3 -> utf8mb4 ? I’m not sure if utf8mb3 can store emojisthe
maybe_convert_table_to_utf8mb4
function emits the “SHOW TABLE STATUS LIKE ‘$table'” query I’ve seenI’ve checked the tables, and all wp_em_* tables are created with
utf8mb3_general_ci
collation, but other wp_* tables are created withutf8mb4_unicode_520_ci
- This reply was modified 1 year, 1 month ago by Bastien Durel.
- This reply was modified 1 year, 1 month ago by Bastien Durel.
- This reply was modified 1 year, 1 month ago by Bastien Durel.
Yes, I edited the values to not put all the text on the forum. I did not though the actual data could change the behaviour
Hello.
Looks like removing an emoji (??) from the main post made it work
Here is the code :
if ( !$wpdb->insert(EM_EVENTS_TABLE, $event_array) ){ $wpdb->print_error(); error_log(print_r($event_array, true)); $this->add_error( sprintf(__('Something went wrong saving your %s to the index table. Please inform a site administrator about this.','events-manager'),__('event','events-manager'))); }
Here is the event array :
[post_id] => 2810 [event_parent] => [event_slug] => chants[…] [event_owner] => 2 [event_name] => Chants[…] [event_timezone] => Europe/Paris [event_start_time] => 10:00:00 [event_end_time] => 16:30:00 [event_start] => 2024-02-04 09:00:00 [event_end] => 2024-02-04 15:30:00 [event_all_day] => 0 [event_start_date] => 2024-02-04 [event_end_date] => 2024-02-04 [post_content] => Départ[…] [event_rsvp] => 0 [event_rsvp_date] => [event_rsvp_time] => [event_rsvp_spaces] => [event_spaces] => [location_id] => 268 [event_location_type] => [recurrence_id] => [event_status] => 1 [event_active_status] => 1 [event_private] => 0 [blog_id] => 0 [group_id] => 0 [event_language] => fr_FR [event_translation] => 0 [recurrence] => 0 [recurrence_interval] => [recurrence_freq] => [recurrence_days] => [recurrence_byday] => [recurrence_byweekno] => [recurrence_rsvp_days] => [event_date_created] => 2024-01-29 19:41:50
So no extra column. No not-null-without-default column either.
Edit: I tcpdump’ed communications with the SQL server, and this request (SHOW FULL COLUMNS FROM
wp_em_events
) is done, without error
Edit 2: I did not found anyINSERT
statement in the dump- This reply was modified 1 year, 1 month ago by Bastien Durel.
- This reply was modified 1 year, 1 month ago by Bastien Durel.
Hello.
This
print_r
is not very useful, as it only displays the data which has to be inserted.But I wrote
$wpdb->print_error();
just after theadd_error()
, and get this message in log file :[29-Jan-2024 19:09:35 UTC] WordPress database error for query SHOW FULL COLUMNS FROM
wp_em_events
made by edit_post, wp_update_post, wp_insert_post, do_action('save_post'), WP_Hook->do_action, WP_Hook->apply_filters, EM_Event_Post_Admin::save_post, EM_Event->save_metaThat’s very strange, because I can run the said query from mysql CLI :
root@agendap:/var/www/html/wordpress/wp-content/plugins/events-manager# mysql --defaults-file=/root/agendap.cnf -h 10.126.0.42 agenda_p Reading table information for completion of table and column names You can turn off this feature to get a quicker startup with -A Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 1315 Server version: 10.11.4-MariaDB-1~deb12u1-log Debian 12 Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [agenda_p]> SHOW FULL COLUMNS FROM wp_em_events; +----------------------+---------------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+ | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment | +----------------------+---------------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+ | event_id | bigint(20) unsigned | NULL | NO | PRI | NULL | auto_increment | select,insert,update,references | | | post_id | bigint(20) unsigned | NULL | NO | MUL | NULL | | select,insert,update,references | | | event_parent | bigint(20) unsigned | NULL | YES | | NULL | | select,insert,update,references | | | event_slug | varchar(200) | utf8mb3_general_ci | YES | | NULL | | select,insert,update,references | | | event_owner | bigint(20) unsigned | NULL | YES | | NULL | | select,insert,update,references | | | event_status | tinyint(1) | NULL | YES | MUL | NULL | | select,insert,update,references | | | event_active_status | tinyint(2) | NULL | YES | MUL | 1 | | select,insert,update,references | | | event_name | text | utf8mb3_general_ci | YES | | NULL | | select,insert,update,references | | | event_start_date | date | NULL | YES | MUL | NULL | | select,insert,update,references | | | event_end_date | date | NULL | YES | MUL | NULL | | select,insert,update,references | | | event_start_time | time | NULL | YES | | NULL | | select,insert,update,references | | | event_end_time | time | NULL | YES | | NULL | | select,insert,update,references | | | event_all_day | tinyint(1) unsigned | NULL | YES | | NULL | | select,insert,update,references | | | event_start | datetime | NULL | YES | MUL | NULL | | select,insert,update,references | | | event_end | datetime | NULL | YES | MUL | NULL | | select,insert,update,references | | | event_timezone | tinytext | utf8mb3_general_ci | YES | | NULL | | select,insert,update,references | | | post_content | longtext | utf8mb3_general_ci | YES | | NULL | | select,insert,update,references | | | event_rsvp | tinyint(1) unsigned | NULL | NO | | 0 | | select,insert,update,references | | | event_rsvp_date | date | NULL | YES | | NULL | | select,insert,update,references | | | event_rsvp_time | time | NULL | YES | | NULL | | select,insert,update,references | | | event_rsvp_spaces | int(5) | NULL | YES | | NULL | | select,insert,update,references | | | event_spaces | int(5) | NULL | YES | | 0 | | select,insert,update,references | | | event_private | tinyint(1) unsigned | NULL | NO | | 0 | | select,insert,update,references | | | location_id | bigint(20) unsigned | NULL | YES | MUL | NULL | | select,insert,update,references | | | event_location_type | varchar(15) | utf8mb3_general_ci | YES | | NULL | | select,insert,update,references | | | recurrence_id | bigint(20) unsigned | NULL | YES | | NULL | | select,insert,update,references | | | event_date_created | datetime | NULL | YES | | NULL | | select,insert,update,references | | | event_date_modified | datetime | NULL | YES | | NULL | | select,insert,update,references | | | recurrence | tinyint(1) unsigned | NULL | NO | | 0 | | select,insert,update,references | | | recurrence_interval | int(4) | NULL | YES | | NULL | | select,insert,update,references | | | recurrence_freq | tinytext | utf8mb3_general_ci | YES | | NULL | | select,insert,update,references | | | recurrence_byday | tinytext | utf8mb3_general_ci | YES | | NULL | | select,insert,update,references | | | recurrence_byweekno | int(4) | NULL | YES | | NULL | | select,insert,update,references | | | recurrence_days | int(4) | NULL | YES | | NULL | | select,insert,update,references | | | recurrence_rsvp_days | int(3) | NULL | YES | | NULL | | select,insert,update,references | | | blog_id | bigint(20) unsigned | NULL | YES | MUL | NULL | | select,insert,update,references | | | group_id | bigint(20) unsigned | NULL | YES | MUL | NULL | | select,insert,update,references | | | event_language | varchar(14) | utf8mb3_general_ci | YES | | NULL | | select,insert,update,references | | | event_translation | tinyint(1) unsigned | NULL | NO | | 0 | | select,insert,update,references | | +----------------------+---------------------+--------------------+------+-----+---------+----------------+---------------------------------+---------+ 39 rows in set (0.001 sec) MariaDB [agenda_p]> ^DBye
- This reply was modified 1 year, 1 month ago by Bastien Durel.
It has all the (39) fields
Thanks for your answer, but it doesn’t help me : as I said, I cannot see any error in logs.
I did not explicitly said it, but I have some events (~200) in database, so I think it cannot be a missing column, or it would have prevented any insertion. (unless they are inserted in different way depending of some context)