getkirby / kirby

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

[Panel] Renamed Title Can Get Reverted When Saving Page Content #1727

Closed neildaniels closed 5 years ago

neildaniels commented 5 years ago

Describe the bug After renaming a page title in the Panel, a situation can occur where saving other content changes reverts the title to the original value. This is much easier to reproduce if you can move "faster" than the server can; you can simulate this by artificially slowing down calls.

Happens on Safari and Chrome.

To Reproduce Steps to reproduce the behavior:

  1. Prepare StarterKit to artificially be slow (described at the bottom)
  2. Open a Note in the Panel, such as http://localhost:8000/panel/pages/notes+across-the-ocean
  3. Rename the page in the Panel
  4. Modify the Text content in the Panel and Save
  5. Everything should still be in sync with the Panel and the content file.
  6. Rename the page in the Panel
  7. While that is saving, click to dismiss the Rename panel.
  8. Change the Text content in the Panel and Save. This must be done quickly after dismissing the Rename panel.

Steps 3 and 4 appear to be essential in causing this error to occur. I cannot reproduce without doing those first.

Here's a video of the steps above (starting at step 2): Screen Recording 2019-04-29 at 1.10.40 PM 3.mov.zip

Expected behavior The Panel and Content File should be in sync. In the video above, the previous title of "Across the ocean 2" is in the Content File, but "Across the ocean 25" is displayed. If you refreshed the page, it would show the "2" variant.

Screenshots

Screen Shot 2019-04-29 at 1 47 42 PM

Kirby Version 3.1.3

Desktop (please complete the following information):

To simulate slowdown:

  1. Create a file at site/models/note.php with the following:
    
    <?php

class NotePage extends Page { public function slowTags() { sleep(2); return []; } }


2. Modify the Blueprint file at `site/blueprints/pages/note.yml` and replace:
```yaml
          tags: true

with:

          tags:
            options: query
            query: page.slowTags()
distantnative commented 5 years ago