Title: post_update problem
Last modified: November 29, 2021

---

# post_update problem

 *  Resolved [dm2021](https://wordpress.org/support/users/dm2021/)
 * (@dm2021)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/post_update-problem/)
 * I had a problem.
    class-object-sync-sf-wordpress.php function post_update() was
   failing. WP Error invalid_post
 * My solution so far has been to move the line (in my source line 1536)
    $content[
   $id_field ] = $post_id; down to *after* the foreach $params, which seemed to 
   be mangling ID with the SF id.
 * If you’ve already fixed this and have a more far reaching fix, please tell me.

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/post_update-problem/#post-15114824)
 * As far as I know this isn’t a widespread error, so I would want to know more 
   about why this error is happening (is it due to how your fieldmap works?) and
   especially how to reproduce it before I would change this. I’m not opposed to
   moving that line if you can show why it causes a problem in your case, and also
   make sure that it doesn’t cause any unexpected problems in other cases.
 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/post_update-problem/#post-15114860)
 * Now that I think about it more, this would potentially cause problems with how
   developer hooks allow developers to modify the parameters. If someone was trying
   to change the WordPress ID with a filter so that it went to another WordPress
   record (for example), this would override that and I’m not sure that I’d be willing
   to do that.
 * I’m still interested in why this is happening for you though. Is your fieldmap
   structured in such a way that it’s trying to save a Salesforce ID into the WordPress
   ID field? As far as I can tell, you shouldn’t ever map something to the WordPress
   ID unless you are storing the WordPress ID itself in Salesforce.
 *  Thread Starter [dm2021](https://wordpress.org/support/users/dm2021/)
 * (@dm2021)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/post_update-problem/#post-15115919)
 * That is in fact exactly what is being done.
    The guy I worked with set it up.
   In the(our) morning I’ll be asking him why.
 * Although it is almost “the obvious thing to to” without knowing not to.
    We are
   at the bottom of the learning curve with this system…
 *  Plugin Author [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * (@jonathanstegall)
 * [4 years, 6 months ago](https://wordpress.org/support/topic/post_update-problem/#post-15117641)
 * It may be that we need to do a check for that and warn users in the interface
   that it’s not necessary to pull anything into the WordPresd ID field.
 * I’ll do some checking into that possibility.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘post_update problem’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/object-sync-for-salesforce.svg)
 * [Object Sync for Salesforce](https://wordpress.org/plugins/object-sync-for-salesforce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/object-sync-for-salesforce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/object-sync-for-salesforce/)
 * [Active Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/object-sync-for-salesforce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/object-sync-for-salesforce/reviews/)

 * 4 replies
 * 2 participants
 * Last reply from: [Jonathan Stegall](https://wordpress.org/support/users/jonathanstegall/)
 * Last activity: [4 years, 6 months ago](https://wordpress.org/support/topic/post_update-problem/#post-15117641)
 * Status: resolved