Public Ticket #4000198

Bug after update 5.3.10 version

Closed
Comments
12 Tickets 8
Miguel Zenha started the conversation 1 year ago on May 15, 2025 at 3:45pm

Hi!

After updating to 5.3.10 version, I lost all my conversations. It shows the number of conversations that exist, but nothing is being showed in the list.

I don't know what happenned but something went wrong.

Hope to hear from you soon.
Best regards and thanks!

2,762
KingsPlugins replied 1 year ago on May 19, 2025 at 6:46pm

Hi Miguel,

Sorry to hear about this issue with conversations after the update. There was indeed a recent change to the conversation structure, but it should have automatically resolved during activation.

 

Since that didn't happen in your case, please try adding this code snippet to your functions.php file or through a code snippets plugin:

add_action('init', function(){
	$conversations = get_posts([
		'post_type' => 'b2bking_conversation',
	  	'numberposts' => -1,
	  	'fields'	=> 'ids',
	  	'skip_sort_reply_time' => 'yes'
	]);

    foreach ($conversations as $post_id) {
        $lastmessagenumber = get_post_meta($post_id, 'b2bking_conversation_messages_number', true);
        
        if (!empty($lastmessagenumber)) {
            $time_last_message = get_post_meta($post_id, 'b2bking_conversation_message_' . $lastmessagenumber . '_time', true);
            
            if (!empty($time_last_message)) {
                update_post_meta($post_id, 'b2bking_conversation_last_reply_time', $time_last_message);
            }
        }
    }
});

This should restore your conversations list. 

 

If you're still experiencing issues after adding this snippet, would you be able to provide temporary admin access to your site so I can take a closer look?

Stefan

12 Tickets 8
Miguel Zenha replied 1 year ago on May 21, 2025 at 8:11am

Hi Stefan,

Thanks for the help.

I think it's a database issue because I tried to migrate a copy to another WordPress instance, and it worked fine.

I'm going to try and run the code snippet that you sent me. I have just one question: do I need to have it always in an active state? Would it be sufficient to run it just once?

Best regards and thanks.

12 Tickets 8
Miguel Zenha replied 1 year ago on May 22, 2025 at 9:55am

The code snippet worked and now all conversations are visible.

Do I need to leave the code snippet always running in order to prevent errors? Or can I deactivate it?

Best regards and thanks

2,762
KingsPlugins replied 1 year ago on May 22, 2025 at 8:27pm

Hi Miguel,

Great to hear the code snippet worked!

Since this was a one-time fix to update your database structure after the plugin update, you can safely deactivate and remove the snippet now. 

 

Kind regards,
Stefan

Sign In