• Resolved dm2021

    (@dm2021)


    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

    (@jonathanstegall)

    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

    (@jonathanstegall)

    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

    (@dm2021)

    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

    (@jonathanstegall)

    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.