silverstripe / silverstripe-versioned-admin

Provides admin UIs for versioned DataObjects in Silverstripe CMS.
BSD 3-Clause "New" or "Revised" License
9 stars 28 forks source link

Files archived before configuring keep_archived_assets show back next buttons which lead to edit screen. #352

Open asecondwill opened 2 months ago

asecondwill commented 2 months ago

Module version(s) affected

2.2.1

Description

Adding keep_archived_assets to the site config on an existing site with archived files leads to this behaviour:

Clicking the next button, and then back buttons leads to the save button being enabled, and the url is now changed

From list, with save disabled: admin/archive/SilverStripe-Assets-File/EditForm/field/Files/item/739/view

After navigating with back next: admin/archive/SilverStripe-Assets-File/EditForm/field/Files/item/739

The ability to save not-kept files confusing our users and allows errors:

When we save an old file, it gets removed from the Archive/Files list. Since the file is not recoverable, we get an error when we try to publish the file.

it then gives a new error when trying to rearchive it.

How to reproduce

  1. have a site with silverstripe 5
  2. Add some files.
  3. Delete some files
  4. configure keep_archived_assets:
    SilverStripe\Assets\File:
    keep_archived_assets: true
  5. view previously archived files in the archive section of the cms
  6. navigate with the next back buttons to show the enabled save button

Possible Solution

dont show the back next buttons

Additional Context

No response

Validations

GuySartorelli commented 2 months ago

Thanks for reporting this. Would you like to give fixing it a go with a pull request?