Support

Account

Home Forums Backend Issues (wp-admin) Media disappears when saving a post

Solved

Media disappears when saving a post

  • Hey,

    This is a repost from wordpress.org/support of an issue I’m also experiencing. No solution has been shared yet. Hope I can get some help here 🙂

    I think i found a bug. A client was doing these steps and i was able to reproduce it.

    – she logged in and pressed edit at a post that i made (so she’s editing it as a different user than the user that created it)
    – opened the ‘media’ page in a new tab
    – uploaded 5 images
    – went back to the other tab, added the images to an ACF (Advanced Custom Fields) repeater field
    – pressed update

    Then all images vanished, and also from the media library. When i opened a page where i can add an ACF page link, all these images where listed as pages / inherit. So i think ‘Post type switcher’ changes the status/type of the attachment.
    It must have to do with ‘Post type switcher’ because i repeated these steps again and again with a backup of the database, and when i disabled ‘Post type switcher’ the problem disappeared.

    A screencast showing it:
    https://www.dropbox.com/s/gxnvjjdk469az23/post_type_switcher_bug.mp4?dl=0

    Any ideas?

    Thanks

  • I would comment out line 90 of the post type switcher plugin

    
    add_filter( 'wp_insert_attachment_data', array( $this, 'override_type' ), 10, 2 );
    

    I don’t see any reason why anyone would want to change the post type of attachments.

    Honestly, the plugin has not been updated in over a year, not even to update the tested up to value, and from the looks of the support forum it is not getting any. I wouldn’t use this plugin at all. If you really need this then I’d deactivate this plugin and only activate it when needed. How often do post types need to be switched?

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Media disappears when saving a post’ is closed to new replies.