Skip to content

[6.x] Restoring revisions causes JS error #13624

@mscruse

Description

@mscruse

Bug description

When you go to restore a revision there is a JS error when you select the revision you want and click the restore button. The modal does not close back to the editor screen and show the restored content. If you do refresh your browser window you will see the restored content when the page reloads.

How to reproduce

New Statamic install, upgrade to 6.x. Enable revisions.

Edit an entry and click save to create a revisions.

Edit that same entry, click the "View History" button to open the list of revisions.

Select a revision to restore - the revision appears but the following error is produced.

You must provide a `url` string or `action` function to be run with your `Edit Blueprint` command index-B95MZo28.js:158:26414
    #e http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:158
    Command http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:158
    add http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:158
    addToCommandPalette http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:267
    mounted http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:267
    createHook http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:18
    callWithErrorHandling http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:17
    callWithAsyncErrorHandling http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:17
    __weh http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:18
    flushPostFlushCbs http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:17
    flushJobs$1 http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:17
    (Async: promise callback)
    queueFlush$1 http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:17
    queueJob$1 http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:17
    scheduler http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:18
    trigger http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:10
    endBatch http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:10
    trigger$1 http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:10
    set http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:10
    set http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:18
    getItem http://test.test/vendor/statamic/cp/build/assets/index-B95MZo28.js:266

Click the Restore button, the confirmation modal appears. Accept, modal closes but the revision window stays open.

Refresh your browser and on reload the previous revision content is shown as expected.

Logs

Environment

Environment
Application Name: Statamic
Laravel Version: 12.48.1
PHP Version: 8.4.17
Composer Version: 2.9.3
Environment: local
Debug Mode: ENABLED
URL: test.test
Maintenance Mode: OFF
Timezone: UTC
Locale: en

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: log
Cache: file
Database: sqlite
Logs: stack / single
Mail: log
Queue: sync
Session: file

Storage
public/storage: NOT LINKED

Statamic
Addons: 0
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 6.0.0-beta.3 PRO

Installation

Fresh statamic/statamic site via CLI

Additional details

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions