getkirby / kirby

Kirby's core application folder
https://getkirby.com
Other
1.26k stars 166 forks source link

[v4] Tags field with query error in page create dialogue #5231

Closed houdini-rites closed 1 year ago

houdini-rites commented 1 year ago

Description

Adding a tags field in the new page create dialogue throws an error this.options.filter is not a function when I start typing a tag. This seems to happen when the tags field on the page uses dynamic options with query of tags from sibling pages. If I remove the query options it works fine.

Screenshots

To reproduce

  1. Get the starterkit
  2. In album.yml add a page create option with a tags field
  3. In album.yml add query options to the tags field with page.siblings.pluck("tags", ",", true)
  4. In the panel go to the photography page and click + to add a new subpage
  5. Start writing a tag in the page create dialogue, see error

Your setup

Kirby Version
4.0.0-alpha.2

Console output

TypeError: this.options.filter is not a function
    search http://localhost/starterkit/media/panel/9a459044c0e9d589a8dfb36aa8947cc2/js/index.js:1
    onType http://localhost/starterkit/media/panel/9a459044c0e9d589a8dfb36aa8947cc2/js/index.js:1
    input http://localhost/starterkit/media/panel/9a459044c0e9d589a8dfb36aa8947cc2/js/index.js:1
    VueJS 3

Your system (please complete the following information)

distantnative commented 1 year ago

@bastianallgeier seems like the fields in the dialog aren't properly processed (their blueprints). Instead of the options from the query, it receives the raw blueprint pattern

distantnative commented 1 year ago

Found a solution