elFinder icon indicating copy to clipboard operation
elFinder copied to clipboard

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

Open blutorange opened this issue 11 months ago • 4 comments

Describe the bug

TUIImageEditor stops working when switching to a different working directory.

To Reproduce

https://github.com/user-attachments/assets/4c366681-4765-4d3f-988c-8fd9ad47e504

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:

https://github.com/Studio-42/elFinder/blob/7544918a2ba656a4fe72a6fc8bb502d39f601cda/js/extras/editors.default.js#L465-L466

blutorange avatar Jan 31 '25 13:01 blutorange

This issue is stale because it has been open for 50 days with no activity.

github-actions[bot] avatar Mar 23 '25 02:03 github-actions[bot]

Please keep open

blutorange avatar Mar 23 '25 14:03 blutorange

This issue is stale because it has been open for 50 days with no activity.

github-actions[bot] avatar May 13 '25 02:05 github-actions[bot]

Please keep open

blutorange avatar May 14 '25 04:05 blutorange

This issue is stale because it has been open for 50 days with no activity.

github-actions[bot] avatar Jul 04 '25 02:07 github-actions[bot]

Please keep open

blutorange avatar Jul 10 '25 14:07 blutorange

This issue is stale because it has been open for 50 days with no activity.

github-actions[bot] avatar Aug 31 '25 02:08 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar Sep 15 '25 02:09 github-actions[bot]