H5P WordPress plugin: tags silently dropped
Submitted by fortran77 on Thu, 01/30/2025 - 19:47
Forums:
Hello,
in the process of migrating 8k Drupal 7 H5P nodes to WordPress via a custom Python script, I generated tags with metadata from the Drupal content type in order to categorize the contents in WordPress.
However, I found that many tags were silently dropped.
I troubleshooted the issue and found that the h5p_tags table name field was varchar(31) and that the following line in admin/class-h5p-content-admin.php
$wpdb->insert("{$wpdb->prefix}h5p_tags", $exists, array('%s'));
did not have any error checking for null returns.
Hence two feature requests:
- Increase the lenght of the tag name field to at least 200 chars to be in line with WordPress taxonomy.
- Add error checking to the $wpdb->insert to detect null value and alert of database errors.
- Or, even better, make the H5P content a regular custom WordPress post type.