Bug #19123
closedInconsistent Menu Saving from Theme Customizer
0%
Description
When attempting to add new menu items to my site via the theme customizer, I've noticed that the changes don't always save correctly. Instead, I have to manually save them by navigating to the admin dashboard under Appearance > Menu.
The issue is intermittent for reasons I don't understand, but I have been able to replicate it across different themes (e.g. Puskar, Twenty Fifteen). While it could be a quirk on my end, I thought I'd submit a ticket with a screen-recording in case others have experienced something similar. Glad to explain further or to attach additional screen-recordings for reference.
Files
Related issues
Updated by Raymond Hoh about 1 year ago
Thanks for the screen recording, Zach.
We have some custom menu caching that might be conflicting when using the Customizer to update the menus. Here's the portion of the code: https://github.com/cuny-academic-commons/cac/blob/9bf108667058a4da8643d20c1e0d16dcc9f0495c/wp-content/mu-plugins/cac-functions.php#L1827-L1946 . I'll try to look into this early next week, but perhaps Boone can beat me to it.
Updated by Colin McDonald about 1 year ago
Thanks from me too Zach, and adding Boone as a watcher in case it helps coordinate on a fix.
Updated by Boone Gorges about 1 year ago
- Related to Feature #10728: Cache primary nav menu added
Updated by Boone Gorges about 1 year ago
- Category name set to WordPress (misc)
- Status changed from New to Staged for Production Release
- Target version set to 2.2.2
Zach, thanks for the report, and Ray, thanks for pointing to this portion of the codebase. I was able to reproduce some odd behavior with Menus in the Customizer, and when I bypassed the static HTML cache for these nav menus, the funniness went away. I didn't spend a great deal of time figuring out exactly why - it could have to do with the way that WP handles transients in Customizer previews. But since it seems to be Customizer-specific, a straightforward fix is to skip the caching when in the Customizer context. I've done so in https://github.com/cuny-academic-commons/cac/commit/3e7e9fd1e3766627b003c6006e47a8108d57bf55, and the fix will be in the next maintenance release.
Updated by Boone Gorges about 1 year ago
- Status changed from Staged for Production Release to Resolved