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

Error from CMD+S whilst cursor is in post slug field #8551

Closed
cobbspur opened this issue Jun 8, 2017 · 1 comment · Fixed by TryGhost/Admin#738
Closed

Error from CMD+S whilst cursor is in post slug field #8551

cobbspur opened this issue Jun 8, 2017 · 1 comment · Fixed by TryGhost/Admin#738
Assignees
Labels
affects:admin Anything relating to Ghost Admin bug [triage] something behaving unexpectedly
Milestone

Comments

@cobbspur
Copy link
Member

cobbspur commented Jun 8, 2017

Issue Summary

When editing a post slug in PSM, saving with CMD+S whist the cursor is still in the slug field throws an error: Attempted to handle event 'becameError' on <post:id> while in state root.loaded.saved

Steps to Reproduce

  1. Open PSM
  2. Change slug leaving cursor in the slug field
  3. Press Cmd+S

Two save requests will be triggered, the first will be successful and have the old slug, the second will have the new slug but will fail with an internal server error with the message Saving failed! Someone else is editing this post.

There are a two issues here:

  • we should only fire a single save with the new slug
  • the alert message should show the message received from the server not an internal Ember error

Technical details:

  • Ghost Version: 1.0.0-alpha.21
  • Browser/OS: Chrome
@kevinansfield kevinansfield added affects:admin Anything relating to Ghost Admin bug [triage] something behaving unexpectedly labels Jun 8, 2017
@kirrg001 kirrg001 added the P2 - High [triage] High priority for immediate patch release label Jun 8, 2017
@kevinansfield kevinansfield changed the title Bug: PSM editing post slug Collision error when CMD+S pressed with cursor in post slug field Jun 8, 2017
@kevinansfield kevinansfield changed the title Collision error when CMD+S pressed with cursor in post slug field Error from CMD+S whilst cursor is in post slug field Jun 8, 2017
@kevinansfield kevinansfield removed the P2 - High [triage] High priority for immediate patch release label Jun 8, 2017
@aileen
Copy link
Member

aileen commented Jun 12, 2017

This happens also on LTS (see #8563).

@kevinansfield kevinansfield self-assigned this Jun 12, 2017
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Jun 13, 2017
refs TryGhost/Ghost#8551
- renames editor-base-controller.generateSlug to generateSlugFromTitle
- moves `updateSlug` logic from PSM to editor base controller
- moves editor base controller save logic into a `save` task
- adds `updateSlug` and `save` into a `saveTasks` task group so that calls are queued rather than running concurrently
- sets the editor controller on the PSM when accessing the new/edit routes - we use a base controller mixin so the slug/save logic is duplicated on new/edit controllers meaning we need to add a reference manually rather than relying on dependency injection
- remove titleObserver checks for non-existent titleObserver
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Jun 13, 2017
refs TryGhost/Ghost#8551
- renames editor-base-controller.generateSlug to generateSlugFromTitle
- moves `updateSlug` logic from PSM to editor base controller
- moves editor base controller save logic into a `save` task
- adds `updateSlug` and `save` into a `saveTasks` task group so that calls are queued rather than running concurrently
- sets the editor controller on the PSM when accessing the new/edit routes - we use a base controller mixin so the slug/save logic is duplicated on new/edit controllers meaning we need to add a reference manually rather than relying on dependency injection
- remove titleObserver checks for non-existent titleObserver
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Jun 13, 2017
refs TryGhost/Ghost#8551
- renames editor-base-controller.generateSlug to generateSlugFromTitle
- moves `updateSlug` logic from PSM to editor base controller
- moves editor base controller save logic into a `save` task
- adds `updateSlug` and `save` into a `saveTasks` task group so that calls are queued rather than running concurrently
- sets the editor controller on the PSM when accessing the new/edit routes - we use a base controller mixin so the slug/save logic is duplicated on new/edit controllers meaning we need to add a reference manually rather than relying on dependency injection
- remove titleObserver checks for non-existent titleObserver
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Jun 13, 2017
refs TryGhost/Ghost#8551
- renames editor-base-controller.generateSlug to generateSlugFromTitle
- moves `updateSlug` logic from PSM to editor base controller
- moves editor base controller save logic into a `save` task
- adds `updateSlug` and `save` into a `saveTasks` task group so that calls are queued rather than running concurrently
- sets the editor controller on the PSM when accessing the new/edit routes - we use a base controller mixin so the slug/save logic is duplicated on new/edit controllers meaning we need to add a reference manually rather than relying on dependency injection
- remove titleObserver checks for non-existent titleObserver
kevinansfield added a commit to kevinansfield/Ghost-Admin that referenced this issue Jun 13, 2017
closes TryGhost/Ghost#8551
- move `updateSlug` logic from `gh-post-settings-menu` component to `editor-base-controller` mixin
- put `updateSlug` and `save` into a task group so that concurrent calls are queued - means that pressing Cmd-S with the cursor still in the slug field will first trigger the `updateSlug` call (triggered by the field blur) then trigger the `save` call (triggered by Cmd-S) when `updateSlug` has finished so there are no conflicts and you still see the "saved" notification
@kirrg001 kirrg001 added this to the 0.11.10 milestone Jun 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects:admin Anything relating to Ghost Admin bug [triage] something behaving unexpectedly
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants