I took over a project and for some reason previous programmer modified wordpress core in few places. Suddenly one thing stoped working and I can't find a reason why. All values are correct just no update to database. Now let me get into more details. This line of code
update_post_meta($id, 'main_category', $main_category);
works fine when meta value in database is empty, not null, just empty. But when there is any value it doesn't work at all and old value is as it was before. Have anyone experienced any problems with that or have any ideas what could be causing the problem?