WordPress.org

Ready to get started?Download WordPress

Forums

Ultimate Post Type Manager
[resolved] Deactivating/Activating UPTM may cause custom field data loss (6 posts)

  1. James Revillini
    Member
    Posted 3 years ago #

    SUMMARY
    Deactivating and reactivating Ultimate Post Type Manager 1.6.8 may cause custom field data loss if the data was stored using multiple checkboxes for a field.

    TO REPRODUCE
    1. Create a custom post type "foo" with a custom field attached who has values "A", "B", and "C" available as checkboxes.
    2. Create a new "foo", check off "A", "B", "C"
    3. Save - confirm you see "A", "B", "C" checked off.
    4. Go to Plugins and deactivate UPTM
    5. Enable UPTM
    6. Edit the "foo" your created - the fields are no longer checked off

    THERE IS NO WORKAROUND - THIS IS A CRITICAL BUG THAT WILL CAUSE YOU TO LOSE DATA WITH NO RECOVERY EXCEPT FROM A DATABASE BACKUP IF YOU HAVE ONE.

    I went into the database and examined the wp_postmeta before deactivate/reactivate and after. Here's before:
    a:1:{s:8:"checkbox";a:2:{s:8:"Outgoing";s:8:"Outgoing";s:14:"'xydac-null'";s:10:"xydac-null";}}

    After:
    a:1:{s:8:"checkbox";b:0;}

    DO NOT DEACTIVATE/REACTIVATE THIS PLUGIN UNTIL THIS HAS BEEN CONFIRMED FIXED BY XYDAC.

    XYDAC - I'll try to help with this but first I have to try to recover as much data as possible from a backup file.

  2. James Revillini
    Member
    Posted 3 years ago #

    DATA RESTORE PROCEDURE

    **BEFORE YOU FOLLOW THIS: BACKUP YOUR DATABASE - I know it's screwed up, but if this screws it up more, I want you to be able to recover. You follow this advice at your own risk. I won't be responsible for the result on your data.**
    **NOTE: this procedure is ONLY for the bug described above. Don't use it for other problems because you may well screw up your data more.**
    **ALSO: this ONLY works if you have a backup of your database BEFORE the deactivate/reactivate AND the backup was using version UPTM 1.6.7 or 1.6.8**
    **FINALLY: If you're not an expert user of phpmyadmin or mysql, don't try this. It's advanced and I don't have time to explain how to use phpmyadmin or the mysql prompt.**

    This procedure will fix all of the custom field data that your posts contained for whichever posts are in your backup. Posts created after the fact will need to be manually fixed.

    If the backup was from UPTM 1.6.8:

    1. 1. backup your wp_postmeta table just in case this DOESN'T work
    2. in your backup from before all your values got erased, isolate just the create table statement and all the insert statements for the wp_postmeta table
    3. copy and paste these into a text editor
    4. find and replace wp_postmeta with wp_postmeta2
    5. copy the resulting code and execute it against your wordpress database using phpmyadmin or the mysql prompt
    6. execute the following SQL statment
      UPDATEwp_postmeta` pm1,
      wp_postmeta2 pm2 SET pm1.meta_value = pm2.meta_value WHERE pm1.meta_id = pm2.meta_id`

    Your data should now be restored for any posts that were in your backup. you still need to fix any new posts created after the data got screwed up.

    ----------------

    If the backup was from UPTM 1.6.7:

    1. Follow the procedure detailed above
    2. Deactivate/Reactivate UPTM ONE TIME AND ONLY ONE TIME

    Your data should now be restored for any posts that were in your backup. you still need to fix any new posts created after the data got screwed up.

  3. XYDAC
    Member
    Plugin Author

    Posted 3 years ago #

    Hey jrevillini,
    Glad to see someone giving complete information regarding a bug found. But sorry to say i couldn't reproduce it. Can you just recheck it. There is some known bug with checkbox, but that doesn't wipe out data.

    Do let me know.

    Regards,
    -Xydac

  4. James Revillini
    Member
    Posted 3 years ago #

    I worked in a QA department for a year and a half. My write up actually lacked OS, browser, and screenshots :) But I'm glad you found it useful.

    Glad you can't reproduce this. I will reinstall just wordpress and UPTM and see if this can be reproduced on a vanilla install. I installed UPTM back in V1.6.6 or so, and I've since moved the site to a new domain, so it's possible that something else is at play.

    I'll write again when I can. Thanks for your quick response.

  5. XYDAC
    Member
    Plugin Author

    Posted 3 years ago #

    Setting this to resolved as bug not confirmed.:)

  6. James Revillini
    Member
    Posted 3 years ago #

    Not a bug in 1.6.9 for sure. I could not find a copy of 1.6.7 and 1.6.8.

    Thanks, XYDAC!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic