Project

General

Profile

Actions

Bug #19123

closed

Inconsistent Menu Saving from Theme Customizer

Added by Zachary Muhlbauer 7 months ago. Updated 7 months ago.

Status:
Resolved
Priority name:
Normal
Assignee:
-
Category name:
WordPress (misc)
Target version:
Start date:
2023-10-27
Due date:
% Done:

0%

Estimated time:
Deployment actions:

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

customize-menu-item.mov (2.94 MB) customize-menu-item.mov Screen-recording of theme customizer issue Zachary Muhlbauer, 2023-10-27 02:59 PM

Related issues

Related to CUNY Academic Commons - Feature #10728: Cache primary nav menuResolvedRaymond Hoh2018-11-19

Actions
Actions #1

Updated by Raymond Hoh 7 months 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.

Actions #2

Updated by Colin McDonald 7 months ago

Thanks from me too Zach, and adding Boone as a watcher in case it helps coordinate on a fix.

Actions #3

Updated by Boone Gorges 7 months ago

Actions #4

Updated by Boone Gorges 7 months 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.

Actions #5

Updated by Boone Gorges 7 months ago

  • Status changed from Staged for Production Release to Resolved
Actions

Also available in: Atom PDF