Discussion about upgrading Sanity version and resolving a bug with hidden fields in schema type definition.
24 replies
Last updated: Jun 30, 2021
G
text: { type: 'string', name: 'type', initialValue: 'text', readOnly: true, hidden: true, },
Jun 30, 2021, 9:19 AM
Which version of the studio are you running? Version
(Appreciate if you use a single message to ask questions by the way, so it's a little easier to reply in a thread
๐)
v2.12.0and
v2.12.1had a bug where this would happen, but it was fixed in
v2.12.2
(Appreciate if you use a single message to ask questions by the way, so it's a little easier to reply in a thread
๐)
Jun 30, 2021, 11:04 AM
G
let me check
Jun 30, 2021, 11:05 AM
G
โ cms git:(feature/form-builder-cms) โ sanity upgrade โ Saved lockfile โ Modules upgraded: @sanity/cli 2.12.0 โ 2.12.2 @sanity/core 2.12.0 โ 2.12.2 @sanity/desk-tool 2.12.0 โ 2.12.2
Jun 30, 2021, 11:07 AM
G
testin right now
Jun 30, 2021, 11:07 AM
G
nope
Jun 30, 2021, 11:07 AM
G
the fields is still there
Jun 30, 2021, 11:08 AM
G
how can I get the version of the studio?
Jun 30, 2021, 11:11 AM
G
I did it
Jun 30, 2021, 11:12 AM
G
but thereโs any studio
Jun 30, 2021, 11:12 AM
Did you restart the sanity development server after upgrading? Also, could you paste the entire schema type definition? Fields should be declared in an array, but the example you showed is an object, so I'm a bit confused
Jun 30, 2021, 11:12 AM
G
yep
Jun 30, 2021, 11:12 AM
G
yeah cause I spread that fields
Jun 30, 2021, 11:12 AM
G
I have this
Jun 30, 2021, 11:13 AM
G
export default [ { title: 'Layout', name: 'layout', type: 'string', fieldset: 'layout', initialValue: 'wide', required: true, options: { list: [ { title: 'Largo', value: 'wide' }, { title: 'Stretto', value: 'narrow' }, ], }, }, { type: 'boolean', name: 'required', title: 'Richiesto', initialValue: false, }, ];
Jun 30, 2021, 11:13 AM
G
export default [ { title: 'Layout', name: 'layout', type: 'string', fieldset: 'layout', initialValue: 'wide', required: true, options: { list: [ { title: 'Largo', value: 'wide' }, { title: 'Stretto', value: 'narrow' }, ], }, }, { type: 'boolean', name: 'required', title: 'Richiesto', initialValue: false, }, ];
Jun 30, 2021, 11:13 AM
G
and Iโm using it in this way
Jun 30, 2021, 11:13 AM
G
fields: [
...defaultForm.fields,
typeOfFields.text,
{
type: 'string',
name: 'label',
title: 'Label del campo',
initialValue: 'Cognome',
},
],
Jun 30, 2021, 11:13 AM
G
where the code above is spread by
...defaultForm.fields
Jun 30, 2021, 11:14 AM
G
But Iโve tried to put them without spread and the result is the same
Jun 30, 2021, 11:16 AM
G
But Iโve tried to put them without spread and the result is the same
Jun 30, 2021, 11:16 AM
G
fixed after a couple restart ๐
Jun 30, 2021, 11:18 AM
G
thank for your time
Jun 30, 2021, 11:18 AM
Sanityโ build remarkable experiences at scale
Sanity is a modern headless CMS that treats content as data to power your digital business. Free to get started, and pay-as-you-go on all plans.