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

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

Open
2 tasks done
asecondwill opened this issue Jul 11, 2024 · 1 comment
Labels
type/bug Something isn't working

Comments

@asecondwill
Copy link

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:

  • Files are shown in the File tab of Archive section.
  • Newly archived files have a restore button.
  • Old archived files:
    • do not have a restore button
    • their save button is disabled.
    • They have back and next record buttons

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
  1. view previously archived files in the archive section of the cms
  2. 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

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)
@GuySartorelli GuySartorelli added the type/bug Something isn't working label Jul 22, 2024
@GuySartorelli
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants