ServerPress / sync-menus

Repository for the WPSiteSync for Menus add-on
2 stars 1 forks source link

Pulling menus from Target site not functioning #12

Open davejesch opened 5 years ago

davejesch commented 5 years ago

STEPS TO REPRODUCE:

  1. Create menu on Source site
  2. Push to Target
  3. Make changes to menu on Target
  4. Pull menu from Target to Source

RESULT:

Get the message "Failed to Sync Menu. Please Save Changes First." but no changes were made to the menu on the Source site so no need to save the changes before performing the Pull.

EXPECTED RESULT:

Successful Pull of menu from Target site.

davejesch commented 5 years ago

In researching this, it seems that any Pull request will fail. The error is incorrectly being displayed as "Failed to Sync. Please save Changes first."

Also, noticed that Push operations are not behaving correctly: the code is not finding and updating an existing menu, rather it deletes the menu and creates it all over again.

The plugin is using postmeta data to store source/target ids. It should be using the SyncModel for this purpose.

Parent IDs are not correctly being matched up so child menu items are being sync'd as a flat menu in some cases.

A complete rewrite of the code will be needed to address these issues.

davejesch commented 5 years ago

Updated the code. Not ready for testing just yet as this requires an update to WPSS core which has not yet be checked in.