• Hi Otto,
    I’ve found quite a subtle bug and haven’t tracked down the cause yet.

    If I have a custom post type and I turn on the publish from backend option all the backend links to edit that post break.

    So say I have a post-type called “Animals”, in the admin edit screen I get a list of all my animals, with the “Publisher” option enabled whenever I click on an animal’s title to edit it – it takes me to the wrong page.

    The really weird thing is that the URLs remain correct, I can see that the correct post ID is in the link, but when I visit that URL I get the wrong post. The site frontend works perfectly, it’s just the admin routing that’s corrupted.

    So if my post ID for an animal called “Samson” is 1848, when I visit /?p=1848 on the frontend I get “Samson” but if I visit /wp-admin/post.php?post=1848&action=edit on the admin I get some other animal – and it’s not even the same one each time!

    Turn off the publish option in SFC and everything works again.

    Builtin post types work correctly, it’s just custom post types that are impacted.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Bizarre. SFC doesn’t change the editor in this way at all, as far as I know. Could be a weird combination of circumstances with some other plugin though. Do you have any other plugins that add special shortcodes or filtering to post content? Try disabling them, see if that changes things.

    Thread Starter benz001

    (@benz001)

    I suspect you’re right with the plugin combo theory, but just to clarify: it’s not the editor content that’s wrong – it actually loads completely the wrong post, but with the right URL.

    So wrong title, wrong media, wrong content, wrong taxonomy data, wrong meta values etc.
    It’s as if it’s corrupting the global $wp_query for custom post types or just replacing the global $post var with a different post.

    The post it serves up is of the correct post type but it’s a different post.

    The module also detects an error – on the custom page I see this in the metabox “If you can see this, then there is some form of problem showing you the Facebook publishing buttons. This may be caused by a plugin conflict or some form of bad javascript on this page. Try reloading or disabling other plugins to find the source of the problem.”

    If I activate the publish option but comment out the contents of the sfc_publish_meta_box function it works, with a bit more digging I’ve traced it to line 120 in that file

    // look for the images/video to add with image_src
    	$images = sfc_media_find_images($post);

    The problem first occurs on the call to sfc_media_find_images() – but that’s as far as I’ve got, as soon as I started var_dumping $post inside that function the problem vanished.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Simple Facebook Connect] Bug with Custom post types and publish’ is closed to new replies.