uoregon / WPSpin

A WordPress plugin providing integration with Spinitron's SpinPAPI API service.
GNU General Public License v2.0
3 stars 5 forks source link

Bug on show import #16

Closed Pythagory closed 11 years ago

Pythagory commented 11 years ago

Reported by email:

importing [...] runs without checking if data is empty: update_post_meta($id, "wpspin_show_showurl", $show['ShowUrl']); So when I edit the show for the first time in metaBoxSave, it will get the metadata and the assumption made was the empty string means it doesn't exist, which in this case it actually exists but with an empty string. So then it tries to add_post_meta, but fails since unique is enforced(which is the right thing to do). So the metadata doesn't update. A fix is not to do update_post_meta when importing on editable metadata fields that are empty. Or, right after doing add_post_meta, check if it failed. If it did then it already exists, so then do update_post_meta.

Pythagory commented 11 years ago

Updated: Apparently this was referring to an old version, no longer relevant.