Gallery settings: ReferenceError: postboxes is not defined
-
Hello guys,
I discovered a strange bug which affects only slow-running web browsers:
When I open a photo gallery to edit its name, title image etc., I simply cannot expand “Gallery settings” box. The browser console reports the following error:
ReferenceError: postboxes is not definedAfter some investigation, I found the problematic code is defined in wp-content/plugins/nextgen-gallery/products/photocrati_nextgen/modules/ngglegacy/admin/manage-images.php file:
// Some third party plugins alter when postboxes are enqueued, so give this line a second to wait for it to be available setTimeout(function() { postboxes.add_postbox_toggles('ngg-manage-gallery'); }, 1000);Apparently, the code above is waiting for a hard-coded time period to load some piece of the page. But if the gallery has too many items and the browser is slow enough, the waiting period is simply too short and the postboxes element is not defined yet. The simplest fix is just to extend the timeout period, but it would be nice to implement this function better 🙂
Klasyc
The topic ‘Gallery settings: ReferenceError: postboxes is not defined’ is closed to new replies.