jaredcobb / ccb-core

Church Community Builder Core API - A WordPress plugin to sync your church data
http://www.wpccb.com
GNU General Public License v2.0
8 stars 5 forks source link

Custom taxonomy failing to update #28

Open uamv opened 4 years ago

uamv commented 4 years ago

I've created a class in order to sync a custom taxonomy ccb_core_group_campus according to these instructions. This class currently sits in a custom plugin on the site.

Upon syncing with the CCB, new core groups that are being inserted into WordPress have the ccb_core_group_campus properly populated. However, core groups that already exist on the site are not being updated with the campus as marked in CCB.

Is there some special filter or flag I need to include in order to not only allow custom taxonomies to insert for new posts, but also update for existing ones? Is there some other way I might not be implementing this properly?

Or, is this a known limitation for custom taxonomies or a bug in the plugin?

Please note that we've had to revert to version 1.06 as sync was failing due to a missing PHP function (even though our PHP showed it present) — a different issue we were not able to sort, but worth noting, as we look to solve this one.

Thanks for any assistance you can offer!

jaredcobb commented 4 years ago

@uamv If I understand correctly, I believe I can explain why that would happen. The plugin attempts to be a little more efficient with the synchronization by first checking to see if the Group has been updated in CCB since the last time it synchronized.

So in this case, if you synchronized your groups at one point, without the new campus taxonomy, then added the new taxonomy class... Any synchronizations your run moving forward will only trigger for a group if its last modified date is updated in CCB.

As a quick test, you can make a trivial change to a group in CCB that existed before, but doesn't have the campus taxonomy (change its name from Jim's Small Group to Jim's Small Group Temp and then back again). If the campus gets updated that should confirm what's going on.

In order to get everything synchronized, I've found the best method is to just delete all of the groups from WordPress and kick off a manual sync. (WordPress will download everything again).

As for the missing function, if it happened to be the Sodium encryption methods, there's a new version of the plugin that fixes this issue. You can see the answer here https://github.com/jaredcobb/ccb-core/issues/27. If that's the case, and you would like to test 1.0.8 I'd love to hear if it works or if you have any problems with it. Thanks.