getkirby / kirby

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

[3.6.0-rc.1] Slug field in structure field: `Cannot read properties of null (reading '$invalid')` #3826

Closed afbora closed 3 years ago

afbora commented 3 years ago

Describe the bug

Getting following error when using new slug field in structure field:

Cannot read properties of null (reading '$invalid')

test:
  label: Test
  type: structure
  fields:
    foo:
      type: text
    bar:
      type: slug
      sync: foo

To Reproduce
Steps to reproduce the behavior:

  1. Use new slug field in any structure field
  2. See error

Expected behavior

Screenshots

Kirby Version

3.6.0-rc.1

Console output

TypeError: Cannot read properties of null (reading 'trim')
    at a.sluggify (index.js:1)
    at a.data (index.js:1)
    at a.<anonymous> (vendor.js:6)
    at vendor.js:6
    at vendor.js:6
    at yn (vendor.js:6)
    at a.Cn._init (vendor.js:6)
    at new a (vendor.js:6)
    at vendor.js:6
    at init (vendor.js:6)
errorCaptured @ index.js:1
Bt @ vendor.js:6
(anonymous) @ vendor.js:6
(anonymous) @ vendor.js:6
yn @ vendor.js:6
Cn._init @ vendor.js:6
a @ vendor.js:6
(anonymous) @ vendor.js:6
init @ vendor.js:6
(anonymous) @ vendor.js:6
f @ vendor.js:6
v @ vendor.js:6
f @ vendor.js:6
v @ vendor.js:6
f @ vendor.js:6
(anonymous) @ vendor.js:6
t._update @ vendor.js:6
r @ vendor.js:6
vn.get @ vendor.js:6
vn @ vendor.js:6
(anonymous) @ vendor.js:6
Cn.$mount @ vendor.js:6
Cn.$mount @ vendor.js:6
init @ vendor.js:6
(anonymous) @ vendor.js:6
f @ vendor.js:6
v @ vendor.js:6
f @ vendor.js:6
(anonymous) @ vendor.js:6
t._update @ vendor.js:6
r @ vendor.js:6
vn.get @ vendor.js:6
vn @ vendor.js:6
(anonymous) @ vendor.js:6
Cn.$mount @ vendor.js:6
Cn.$mount @ vendor.js:6
init @ vendor.js:6
(anonymous) @ vendor.js:6
f @ vendor.js:6
(anonymous) @ vendor.js:6
t._update @ vendor.js:6
r @ vendor.js:6
vn.get @ vendor.js:6
vn @ vendor.js:6
(anonymous) @ vendor.js:6
Cn.$mount @ vendor.js:6
Cn.$mount @ vendor.js:6
init @ vendor.js:6
(anonymous) @ vendor.js:6
f @ vendor.js:6
(anonymous) @ vendor.js:6
t._update @ vendor.js:6
r @ vendor.js:6
vn.get @ vendor.js:6
vn @ vendor.js:6
(anonymous) @ vendor.js:6
Cn.$mount @ vendor.js:6
Cn.$mount @ vendor.js:6
init @ vendor.js:6
(anonymous) @ vendor.js:6
f @ vendor.js:6
v @ vendor.js:6
f @ vendor.js:6
v @ vendor.js:6
f @ vendor.js:6
(anonymous) @ vendor.js:6
t._update @ vendor.js:6
r @ vendor.js:6
vn.get @ vendor.js:6
vn @ vendor.js:6
(anonymous) @ vendor.js:6
Cn.$mount @ vendor.js:6
Cn.$mount @ vendor.js:6
init @ vendor.js:6
(anonymous) @ vendor.js:6
f @ vendor.js:6
v @ vendor.js:6
f @ vendor.js:6
(anonymous) @ vendor.js:6
t._update @ vendor.js:6
r @ vendor.js:6
vn.get @ vendor.js:6
vn @ vendor.js:6
(anonymous) @ vendor.js:6
Cn.$mount @ vendor.js:6
Cn.$mount @ vendor.js:6
init @ vendor.js:6
(anonymous) @ vendor.js:6
f @ vendor.js:6
v @ vendor.js:6
f @ vendor.js:6
(anonymous) @ vendor.js:6
t._update @ vendor.js:6
r @ vendor.js:6
vn.get @ vendor.js:6
vn @ vendor.js:6
(anonymous) @ vendor.js:6
Cn.$mount @ vendor.js:6
Cn.$mount @ vendor.js:6
init @ vendor.js:6
(anonymous) @ vendor.js:6
f @ vendor.js:6
v @ vendor.js:6
f @ vendor.js:6
(anonymous) @ vendor.js:6
t._update @ vendor.js:6
r @ vendor.js:6
vn.get @ vendor.js:6
vn @ vendor.js:6
(anonymous) @ vendor.js:6
Cn.$mount @ vendor.js:6
Cn.$mount @ vendor.js:6
init @ vendor.js:6
(anonymous) @ vendor.js:6
f @ vendor.js:6
v @ vendor.js:6
f @ vendor.js:6
(anonymous) @ vendor.js:6
_ @ vendor.js:6
(anonymous) @ vendor.js:6
t._update @ vendor.js:6
r @ vendor.js:6
vn.get @ vendor.js:6
vn.run @ vendor.js:6
dn @ vendor.js:6
(anonymous) @ vendor.js:6
Ut @ vendor.js:6
Promise.then (async)
qt @ vendor.js:6
te @ vendor.js:6
(anonymous) @ vendor.js:6
vn.update @ vendor.js:6
ct.notify @ vendor.js:6
set @ vendor.js:6
mn.set @ vendor.js:6
add @ index.js:1
Vt @ vendor.js:6
n @ vendor.js:6
i._wrapper @ vendor.js:6
Show 97 more frames
index.js:1 TypeError: Cannot read properties of null (reading '$invalid')
    at a.onInvalid (index.js:1)
    at a.mounted (index.js:1)
    at Vt (vendor.js:6)
    at nn (vendor.js:6)
    at Object.insert (vendor.js:6)
    at O (vendor.js:6)
    at a.__patch__ (vendor.js:6)
    at a.t._update (vendor.js:6)
    at a.r (vendor.js:6)
    at vn.get (vendor.js:6)

Desktop (please complete the following information):

bastianallgeier commented 3 years ago

I ran into the same thing. Something's wrong about the default value for the slug field.