Plugin creates strange post comment objects
-
Hi! For some reason this plugin creates strange post and comment objects. For example:
Comments Scheduled Actions Approved Protected: object_sync_for_salesforce_pull_check_records #320503
OR
Post Scheduled Actions Updated Protected: object_sync_for_salesforce_pull_check_records
Also i have problems with importing some objects. For example i update some object in SF. But it doesn’t appears in wordpress. But field mapping is ok, and some object of this type apears on site time to time.The page I need help with: [log in to see the link]
-
It creates posts and comments because that is how the ActionScheduler library works. You can read more about that at https://actionscheduler.org/.
As for your import issues, that doesn’t give me much to go on. What kind of objects are they? What is the difference between when it does work and when it doesn’t? Does your server have any error logs? Does the plugin create any error logs?
You might be using a third party data structure, of course. This plugin doesn’t necessarily support all of the third party ways of doing data in WordPress, but that may or may not be the issue here.
@jonathanstegall Thank you about explanation about ActionScheduler.
About the object import. In SF it is Person object with several fields, most of them are string type like name, bio, etc. but one field is checkbox. In wordpress it is custom post type Person and beside title and content for other fields i use ACF Pro plugin. So for this SF field with checkbox in wordpress i use custom field with type checkbox(True/False). I have noticed that when object are imported from SF this checkbox is always unchecked. So it looks that it couldn’t import object from SF if this checkbox field in SF is checked. Could it be the reason?@wolfage that sounds like a good thing to try first. It’s possible that the field’s data isn’t translating the way it’s supposed to and it’s causing a failure. I’d say if it always works without checkbox and never works with checkbox, that’s probably the issue.
This plugin certainly doesn’t guarantee support of ACF Pro, but if it were an easy fix for something like this I would certainly consider adding it.
@jonathanstegall Do you know maybe how your plugin import checkbox fields from SF. Is it import it as boolean values with true or false or as a simple string with “true” or “false”?
@wolfage yes. Currently, the data types the plugin checks for when it’s importing data from Salesforce are:
1. date
2. datetime
3. multipicklist
4. integer
5. boolean
6. text
7. urlIf it’s a boolean field coming from Salesforce, the plugin does treat it as an integer. By default this is how WordPress handles true/false in its database, so this plugin follows that convention.
This plugin does have a lot of developer hooks if you needed to change the type to match whatever ACF is doing. You might want to use this one for this kind of thing. Also, there are some cases also where we have code that allows a plugin to handle data in the way it expects, if that plugin is active. We could probably do that with ACF, but we’d have to do some testing and make sure it didn’t mess anything else up, either with ACF or with other plugins.
But in the meantime if you need to change the data type I think you would want to try that filter and see if it can do what you need.
@jonathanstegall Well, problem is not in checkbox. I have imported object with checked checkbox, so this works ok. So need to search more.
By the way, how long could be import process. I mean could it be that i have done updates for huge number of he objects in SF and import all of these changes takes a lot of time. I mean several days? If so, how could i speed up this process?@wolfage I can’t really speak to how fast it should be. It depends on your server and the settings you’ve put in on the plugin’s scheduling tab. You can change those settings around to change how often the plugin runs and how many records it can process. But depending on your server’s capabilities, it could possibly get overloaded if it tries to do too much.
@jonathanstegall Does the size of he content of the some fields in SF could have any influence on import. For example i have for Person object in SF field called bio. There could be a lot of text. Could this be a problem?
@jonathanstegall Also in log i see error Invalid post ID. What this error means, do you know? In log of this plugin i mean
@wolfage I’m not sure I can give you any info on that.
1. The size of fields in SF depends entirely on your setup. For example if you have a max length on a field, it might cause issues. But by default, it doesn’t matter.
2. Invalid post ID could mean a lot of different things. I can’t really give you much there.@jonathanstegall I have enebled debug feature of your plugin and now in log i have next errors:
Error title: Error: WordPress update for event_registration ID 52860 was unsuccessful with these errors:
Error content: `WP_Error Object
(
[errors] => Array
(
[invalid_post] => Array
(
[0] => Invalid post ID.
))
[error_data] => Array
(
))`
Please notice that this errors i have for different post types. So they doesn’t depends from fields type. etc.
What could generate such errors, also maybe you know on which stage plugin log this error? I mean we get this error as response from SF, or it appears when we try to write post in wordpress?Well as you can see, it says “WordPress update was unsuccessful.” This means the plugin tried to update a post type of event_registration with an ID of 52860 but presumably that ID does not exist, which is why it says invalid.
It sounds to me like the plugin is trying to update records that don’t exist.
@jonathanstegall I thought that when plugin see that some object exist in SF but doesn’t exist at the WP then plugin try to create this object in WP?
@wolfage that is kind of true. Here’s how the plugin works, if you have both “create” and “update” enabled on your fieldmap:
1. At intervals, the plugin checks for any new mappable records that have been added to Salesforce. If they exist, it creates maps for them. This way it can pass data back and forth, detect changes, etc.
2. At intervals, the plugin checks for any mapped records that have been updated. If it finds them, it passes the data back and forth again.If the plugin finds a mapping row for two objects – a single contact in SF and a single user in WP for example – but then it finds that the user does not exist, it will fail in the way you have described. It won’t create a new record because it thinks the records are already mapped.
@jonathanstegall Hmmm. I’m not sure that i understand right why plugin doesn’t create new object in WP in last case?
By the way, how could i fix it? Like could we do any changes into plugin to prevent it? Or what need i do manually in Sf or in WP to prevent this trouble?
The topic ‘Plugin creates strange post comment objects’ is closed to new replies.