Saving metabox updates causing fatal error

You are getting that fatal error because your custom mdb_save_metaboxes function is expecting to receive 3 parameters (function mdb_save_metaboxes($post_id, $post, $update)), but WordPress only passed 1 parameter, because you did not tell WordPress that it needs to pass 3 parameters.

So to fix the issue, set the fourth parameter for add_action() like so:

// If you do this, only 1 parameter will be passed to mdb_save_metaboxes:
add_action('save_post', 'mdb_save_metaboxes');

// So do this instead, to ensure that 3 parameters passed to the function.
add_action('save_post', 'mdb_save_metaboxes', 10, 3);

error code: 523