Title: Error creating database entry
Last modified: September 11, 2019

---

# Error creating database entry

 *  [jimoe](https://wordpress.org/support/users/jimoe/)
 * (@jimoe)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/error-creating-database-entry/)
 * wp 5.2.3
    ual 0.10.1
 * I am seeing a lot of errors like that one below in the error log.
    Anyway to 
   correct it?
 * [07-Sep-2019 00:14:39 UTC] WordPress database error Column ‘object_type’ cannot
   be null for query INSERT INTO `wp_ualp_user_activity` (`post_id`, `post_title`,`
   user_id`, `user_name`, `user_role`, `user_email`, `ip_address`, `modified_date`,`
   object_type`, `action`) VALUES (217136, ‘Auto Draft’, 0, ”, ”, ”, ‘216.222.194.171’,‘
   2019-09-06 17:14:39’, NULL, ‘delete ‘) made by do_action_ref_array(‘wp_scheduled_auto_draft_delete’),
   WP_Hook->do_action, WP_Hook->apply_filters, wp_delete_auto_drafts, wp_delete_post,
   do_action(‘before_delete_post’), WP_Hook->do_action, WP_Hook->apply_filters, 
   ual_shook_delete_post, ual_get_activity_function, ual_user_activity_add, W3TC\
   DbCache_Wpdb->insert, W3TC\DbCache_WpdbInjection_QueryCaching->insert, W3TC\_CallUnderlying-
   >insert, W3TC\DbCache_Wpdb->insert, W3TC\DbCache_WpdbInjection->insert, W3TC\
   DbCache_Wpdb->default_insert, W3TC\DbCache_Wpdb->query, W3TC\DbCache_WpdbInjection-
   >query, W3TC\DbCache_Wpdb->default_query

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Sanjay Dabhoya](https://wordpress.org/support/users/sanjaydabhoya/)
 * (@sanjaydabhoya)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/error-creating-database-entry/#post-11947673)
 * Hi [@jimoe](https://wordpress.org/support/users/jimoe/)
 * Sorry for the inconvenience caused to you.
 * Find and replace ual_user_activity_add function for user_functions.php file.
 * if (!function_exists(‘ual_user_activity_add’)) {
 *  function ual_user_activity_add($post_id, $post_title, $obj_type, $current_user_id,
   $current_user, $user_role, $user_mail, $modified_date, $ip, $action) {
    global
   $wpdb; $table_name = $wpdb->prefix . “ualp_user_activity”; $post_title = addslashes(
   $post_title); if($obj_type == ”) { $obj_type = ‘post’; } $insert_query = $wpdb-
   >insert( $table_name, array( ‘post_id’ => $post_id, ‘post_title’ => $post_title,‘
   user_id’ => $current_user_id, ‘user_name’ => $current_user, ‘user_role’ => $user_role,‘
   user_email’ => $user_mail, ‘ip_address’ => $ip, ‘modified_date’ => $modified_date,‘
   object_type’ => $obj_type, ‘action’ => $action, ) ); } }
 * If still your issue exists, let us know.
 * More details on code level you can reach us via slack.
 * Thank you

Viewing 1 replies (of 1 total)

The topic ‘Error creating database entry’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/user-activity-log_2b5346.svg)
 * [User Activity Log](https://wordpress.org/plugins/user-activity-log/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-activity-log/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-activity-log/)
 * [Active Topics](https://wordpress.org/support/plugin/user-activity-log/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-activity-log/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-activity-log/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Sanjay Dabhoya](https://wordpress.org/support/users/sanjaydabhoya/)
 * Last activity: [6 years, 8 months ago](https://wordpress.org/support/topic/error-creating-database-entry/#post-11947673)
 * Status: not resolved