cubica/p2p-wpml — pull request #11 by baden03 (2013-04-10 12:18:03+00:00)
Title: Sync Connections on Duplicate > WP 3.5.1, P2P 1.5.2, WPML 2.7.1

After a brutal 'support' issue with WPML, I finally got fed up and created a work-around that saves P2P connections in the WP DB. This allows connected posts to be copied over when a post is duplicated! I can not tell you how much work this will save on two of my projects.

I have fully tested this on our test server. Feel free to contact me direct and I will give you all required access so you can verify this works on the latest version of WPML.

Basically this is what has been added:
* in the p2p-wpml admin area, there is a new option: Save Current P2P connections to Database.
* now, when a post is duplicated and (for some unknown reason) P2P_Connection_Type_Factory::get_all_instances() returns an empty array, we just grab the stored connections from the database and continue.

Let me know if you have any questions.