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

[BUG] TUIImageEditor stops work when switching to a different working directory #3700

Open
blutorange opened this issue Jan 31, 2025 · 0 comments

Comments

@blutorange
Copy link
Contributor

blutorange commented Jan 31, 2025

Describe the bug

TUIImageEditor stops working when switching to a different working directory.

To Reproduce

Screen.Recording.2025-01-31.141503.mp4

Steps to reproduce the behavior:

  1. Go to https://studio-42.github.io/elFinder/
  2. Open a writable folder with an image
  3. Edit the image in the TUIImageEditor
  4. Exit full screen mode via the toolbar at the top right
  5. Use the file explorer's tree to switch to a different working directory
  6. Focus the TUIImageEditor again and either click save or close the dialog

This now logs an error on the console, and the file is not saved. Also, trying to open an image with the TUIImageEditor again fails, probably since the editor was never properly closed.

Expected behavior

Saving and closing works even when inside a directory different from the directory that contains the image.

E.g. the text area editor does not seem to have this issue.

Additional context

As you can see in the screencast fm.files() does not include the image file when inside a different working directory. The TUIImageEditor, however, tries to access the file via fm.file(hash). This returns undefined, which the editor does not handle properly:

file = this.fm.file(hash);
$base.data('mime', file.mime);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant