Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discard changes not working as intended with slug fields #430

Closed
saasen opened this issue Dec 15, 2017 · 2 comments
Closed

Discard changes not working as intended with slug fields #430

saasen opened this issue Dec 15, 2017 · 2 comments
Labels

Comments

@saasen
Copy link
Contributor

saasen commented Dec 15, 2017

We are experiencing an issue when discarding changes after changing a field in a document which also has a slug field which is sourced to that field is discarded.

Versions:

// package.json
"@sanity/base": "^0.123.0",
"@sanity/components": "^0.123.0",
"@sanity/core": "^0.123.0",
"@sanity/default-layout": "^0.123.0",
"@sanity/default-login": "^0.121.1",
"@sanity/desk-tool": "^0.123.0",
"react": "^15.6",
"react-dom": "^15.6",
"sanity-plugin-vision": "^2.0.7"

Node: 8.4.0
NPM: 5.5.1

Example schema:

// movie.js
export default {
    title: 'Movie',
    name: 'movie',
    type: 'document',
    fields: [
        {
            title: 'Name',
            name: 'name',
            type: 'string'
        },
        {
            title: 'Slug',
            name: 'slug',
            type: 'slug',
            options: {
                source: 'name'
            }
        }
    ]
}

Reproducing:

  • Create an instance of the content model
  • Give the name a name, the slug will be auto-generated
  • Publish
  • Add a word to the title (the slug will follow)
  • Discard the changes
  • The 'Publish changes' button is still active, and the Vision plug-in shows strange results:

image

When experiencing this issue the first time, we had different results, but the result is still strange. We are expecting the document to get properly discarded an the previous version published.

@rexxars
Copy link
Member

rexxars commented Dec 19, 2017

Thanks for a thorough issue report! We'll investigate and get back to you.

@evenwestvang
Copy link
Member

Should be fixed in #585!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants