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

Fixes #15076 - Removes ability to remove the default avatar from disk #15127

Merged
merged 17 commits into from
Jul 20, 2024

Conversation

snipe
Copy link
Owner

@snipe snipe commented Jul 20, 2024

This got a little tricky - if you chose to delete the default.png in the branding settings, it would actually delete it from the disk, but since it was already tracked, this caused a git issue (potentially) on upgrade. This change prevents the file from being deleted, and offers the user the ability to restore it.

I also managed to mostly fix some of the tests that we had to previously skip.

I'm running into an issue with the commented out sections of the test, where it seems to think a file that has been deleted is still there, but I can't tell if that's an artifact of the test, since it works in the browser.

Should hopefully prevent #15076 in the future.

Copy link

what-the-diff bot commented Jul 20, 2024

PR Summary

  • Updates to .gitignore file
    • The testing framework storage directory ('/storage/framework/testing') is now excluded from being tracked by Git.
  • Amendments to ResetDemoSettings.php
    • A default avatar 'default.png' will now be set in the settings when the demo settings are being reset.
  • Changes in SettingsController.php
    • Image deletion logic in the settings is simplified by introducing a new method deleteExistingImage.
    • An additional control has been incorporated that checks whether the default avatar needs to be restored and performs the needful.
  • Improvements to ImageUploadRequest.php
    • Now uses Validator from the Laravel's built-in storage facade.
    • A new method allows the deletion of existing images, reducing code repetition.
  • Enhancements to Setting.php
    • Uses Laravel's built-in Storage class for file management purposes.
    • A method has been included to restore the default avatar if required.
    • Some enhancements have been made inside the method update_client_side_cert_files.
  • Upgrades to SettingsSeeder.php
    • The default avatar 'default.png' is now seeded in the settings table during database seeding.
  • File Rearrangement
    • The file 'public/img/default-sm.png' has been removed.
    • The file 'public/img/default.png' has been moved to 'public/img/demo/avatars/default.png'.
  • Addition to general.php in language resources
    • A new language line for restoring the original default avatar has been created.
  • Modifications to branding.blade.php
    • An optional block has been added that is displayed only when no default avatar is set.

@snipe snipe merged commit 9d890b3 into develop Jul 20, 2024
9 checks passed
@snipe snipe deleted the fixes/small_default_avatar_tweaks branch July 20, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant