Description:
When using Breakdance 2.6.1 alongside a translation plugin (Polylang), opening the "Filter" tab within the Post Loop Builder element causes the UI to crash. The dropdowns for taxonomies/fields fail to load, and an IO-TS validation failed error is thrown in the console.
This happens because translation plugins register hidden background taxonomies (post_translations, term_language, term_translations) and set their text labels to false (boolean) to hide them from the WordPress admin. When Breakdance fetches taxonomies to populate the Filter tab, the strict io-ts validation expects an array of strings (Array<{ text: string, value: string }>). It encounters the false boolean, fails type validation, and immediately halts the UI script.
Steps to Reproduce:
- Install and activate Breakdance 2.6.1, ACF, and Polylang.
- Create an ACF Custom Post Type.
- Open a Breakdance Global Block (or any template/page) in the Breakdance editor.
- Add a "Post Loop Builder" element to the page.
- In the properties panel, go to the "Filter" tab.
- Observe that the filter dropdowns fail to load/populate.
- Open the browser console to see the IO-TS validation failed fatal errors.
Error Messages:
io-ts-errors-to-_error.ts:86 Type `[{"value":"category","text"...` (Array(13)) is not assignable to type `Array<{ text: string, value...` (e)
io-ts-errors-to-_error.ts:86 Type `{"value":"post_translations...` (Object) at path `.[9]` is not assignable to type `{ text: string, value: stri...` (e)
io-ts-errors-to-_error.ts:90 Type `false` at path `.[9].text` is not assignable to type `string` (e)
io-ts-errors-to-_error.ts:86 Type `{"value":"term_language","t...` (Object) at path `.[10]` is not assignable to type `{ text: string, value: stri...` (e)
io-ts-errors-to-_error.ts:90 Type `false` at path `.[10].text` is not assignable to type `string` (e)
io-ts-errors-to-_error.ts:86 Type `{"value":"term_translations...` (Object) at path `.[11]` is not assignable to type `{ text: string, value: stri...` (e)
io-ts-errors-to-_error.ts:90 Type `false` at path `.[11].text` is not assignable to type `string` (e)
Environment Information:
Breakdance Version: 2.6.1
Active Plugins: Advanced Custom Fields (ACF), Polylang
WordPress Version: 6.9.4
Browser & OS: Chrome on Windows 11
Temporary Workaround:
I was able to temporarily resolve this by hooking into init and forcing the labels for those specific hidden taxonomies to return as strings instead of false. However, the Breakdance data-fetching logic for the Post Loop Filter tab should ideally filter out or cast boolean taxonomy labels before passing them to the io-ts validator to prevent this crash natively.
Description:
When using Breakdance 2.6.1 alongside a translation plugin (Polylang), opening the "Filter" tab within the Post Loop Builder element causes the UI to crash. The dropdowns for taxonomies/fields fail to load, and an IO-TS validation failed error is thrown in the console.
This happens because translation plugins register hidden background taxonomies (post_translations, term_language, term_translations) and set their text labels to false (boolean) to hide them from the WordPress admin. When Breakdance fetches taxonomies to populate the Filter tab, the strict io-ts validation expects an array of strings (Array<{ text: string, value: string }>). It encounters the false boolean, fails type validation, and immediately halts the UI script.
Steps to Reproduce:
Error Messages:
Environment Information:
Breakdance Version: 2.6.1
Active Plugins: Advanced Custom Fields (ACF), Polylang
WordPress Version: 6.9.4
Browser & OS: Chrome on Windows 11
Temporary Workaround:
I was able to temporarily resolve this by hooking into init and forcing the labels for those specific hidden taxonomies to return as strings instead of false. However, the Breakdance data-fetching logic for the Post Loop Filter tab should ideally filter out or cast boolean taxonomy labels before passing them to the io-ts validator to prevent this crash natively.