Skip to content

IO-TS validation crash in Post Loop Builder (Filter Tab) due to translation plugin taxonomies #1303

@Alsinf

Description

@Alsinf

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:

  1. Install and activate Breakdance 2.6.1, ACF, and Polylang.
  2. Create an ACF Custom Post Type.
  3. Open a Breakdance Global Block (or any template/page) in the Breakdance editor.
  4. Add a "Post Loop Builder" element to the page.
  5. In the properties panel, go to the "Filter" tab.
  6. Observe that the filter dropdowns fail to load/populate.
  7. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions