wpmetabox / meta-box

The best plugin for WordPress custom fields and custom meta boxes
https://metabox.io
1.18k stars 423 forks source link

Error saving custom patterns and template parts in WP 6.6 #1595

Closed leo020588 closed 2 weeks ago

leo020588 commented 3 weeks ago

Issue Overview

The site editor in WordPress 6.6 is given an error when trying to save a custom pattern o template part.

TypeError: Cannot read properties of undefined (reading 'form')
    at e.<computed>.valid (jquery.validate.js?ver=1.20.0:131:29)
    at editor.savePost (validation.js?ver=5.9.10:239:21)
    at Object.savePostStatus (editor.min.js?ver=734dedd6ead28ee4ca9c:7:150370)
    at data.min.js?ver=7c62e39de0308c73d50c:9:3735
    at editor.min.js?ver=734dedd6ead28ee4ca9c:7:149054
    at editor.min.js?ver=734dedd6ead28ee4ca9c:7:148202
    at n.<computed> (components.min.js?ver=36b97398bf090476214e:27:14952)
    at Object.De (react-dom.min.js?ver=18.3.1:2:16716)
    at Be (react-dom.min.js?ver=18.3.1:2:16870)
    at react-dom.min.js?ver=18.3.1:2:36731

jquery.validate.js?ver=1.20.0:131:29

Steps to Reproduce (for bugs)

  1. Install or update to WordPress 6.6-RC3
  2. Install and activate meta-box plugin (5.9.10)
  3. Register custom meta-box field in functions.php
  4. Add a new Pattern o Template Part from the Site Editor
  5. Edit the contents of the created pattern and try to saved.

Expected Behavior

Save the pattern

Current Behavior

Shows an error in the browser console.

Screenshots / Video

image

tanftw commented 3 weeks ago

Dear @leo020588

Thanks for reporting. I have fixed this issue and tested. Could you please take a moment to test this PR?

https://github.com/wpmetabox/meta-box/pull/1596

Cheers!

leo020588 commented 2 weeks ago

@tanftw It works for me.

tanftw commented 2 weeks ago

Awesome, thank you very much!