• Resolved TheCosmonaut

    (@thecosmonaut)


    I’m getting a REALLY weird error.

    For ALL users besides the initial user set up with the install of WordPress, they are getting strange things where field values in Posts are not populating with correct values. Instead of what you’d expect to see, we’re seeing the following:

    • On the permalink/slug field, the slug is populating with a slug from one of the first couple of posts we ever created. The user can change the value of this slug, save the post, receive a “success” message, and then reload the page — the “new” value will be gone and the “old” slug will be back.
    • On the excerpt field, the area is populating with some lorem ipsum text which I believe came from one of the first couple of posts we ever created. The user can change the value of the excerpt, save the post, receive a “success” message, and then reload the page — the “new” value will be gone and the “old” slug will be back.
    • The “author” for the posts similarly resets itself. The value it resets itself to is the initial user we set up when we installed WordPress.
    • If the initial user we set up when we installed WordPress edits a post, the admin area shows him as still editing the post, even if he logs out entirely.

    I’ve deactivated all plugins, reinstalled wordpress, and I’ve narrowed it down and it appears that the issue is being caused by something in our theme. We built the theme ourselves from the ground up, so I take full credit for messing up my own site ?? The challenge is we’re using functions which we’ve used with no problem on tons of other sites, so I’m scratching my head as to where to start.

    I can brute force fix this by deactivating all our custom code and reactivating it one-at-a-time, but it’d be really nice to know if anyone else has seen errors of this nature or would know what kind of thing would cause errors like these. Initial guesses would be some sort of conflict with post types or some sort of weird user permission conflict (although we haven’t done any custom functionality with user permissions in our theme).

    Any ideas, thoughts, experiences, etc. would be awesome.

    Thanks,
    –eric

Viewing 1 replies (of 1 total)
  • Thread Starter TheCosmonaut

    (@thecosmonaut)

    Found the issue — had a plugin that was pulling references to a custom post type inside the admin area. The plugin was using a global $post value, which was overriding the main query in the admin area, so values from the other page were sneaking into this page.

    Got rid of the global $post, fixed the issue.

Viewing 1 replies (of 1 total)
  • The topic ‘Users having default values inserted, changes not saved’ is closed to new replies.