ServerPress / sync-menus

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

"Error Syncing Menu. Menu data is corrupt." when syncing in WP5.4 RC1 #13

Closed erinmarinas closed 4 years ago

erinmarinas commented 4 years ago

STEPS TO REPRODUCE:

  1. Create a menu named Primary, assign to Desktop Horizontal Menu
  2. Save and Push to Target

RESULT:

"Error Syncing Menu. Menu data is corrupt. Unable to send this menu to Target." source-log.txt No Target logs

EXPECTED RESULT:

Sync goes through

WordPress Version: 5.4 RC1 WordPress Version: 5.4.1

GreggFranklin commented 4 years ago

I can recreate menu_error

WordPress Version: 5.4.1

davejesch commented 4 years ago

@GreggFranklin How? Can you add more information to the Steps to Reproduce?

GreggFranklin commented 4 years ago

STEPS TO REPRODUCE: Create a Source and Target site Create a menu named Primary, assign to Desktop Horizontal Menu(Display location) Save and Push to Target

** I tested again not selecting any "Display location" resulted in same error message. *** Also tested on different "Display Locations" resulted in same error message.

RESULT: "Error Syncing Menu. Menu data is corrupt. Unable to send this menu to Target." No change on Target

EXPECTED RESULT: Menu is pushed to Target

WordPress Version: 5.4.1 Theme: Twentytwenty

Logs: Source~log.txt No Target log created No debug.log's created

davejesch commented 4 years ago

The problem shows up when there is only one declared menu. In that case, there is no <select> to choose the menu. The code was looking for the selected menu and with no <select>, this doesn't work.

Updated the code to use the #menu <input> field and the <select> as a fallback. Also cleaned up the styling for menu message area.

erinmarinas commented 4 years ago

Fix working