Image edit - save and close button not working
TobsBobs opened this issue · 20 comments
Steps to reproduce the issue
Select and edit an image
use the button save and close
back to the image and folder list
the change from the image has not saved
Expected result
The changed image should display and not the original
System information (as much as possible)
php: Windows NT TOBSBOBS 10.0 build 17134 (Windows 10) i586
dbserver: mysql
dbversion: 5.5.5-10.1.33-MariaDB
dbcollation: latin1_swedish_ci
dbconnectioncollation: utf8_general_ci
phpversion: 7.2.6
server: Apache/2.4.33 (Win32) OpenSSL/1.1.0h PHP/7.2.6
sapi_name: apache2handler
version: Joomla! 4.0.0-alpha5-dev Development [ Amani ] 22-July-2018 22:58 GMT
useragent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:62.0) Gecko/20100101 Firefox/62.0
Joomla Build = These packages were built based on commit 3596efb
Additional comments
I can't test with the latest version a.t.m. It looks a bit familiar with #561 that has to do with Windows, Firefox and asynchronous ajax calls but only for "Save & Close" not "Save".
- Could you test with another browser e.g. Chrome or Edge,
- Could you open Firefox's Developer/Console Log to check for Javascript errors.
Hello @schnuti,
1
I get no js error in the console:
2
In Chrome and Edge it works. But i found a little bug in all three webbrowser. The image-list will not be updated. It still shows the old picture. I will open another issue für this bug.
I load the new nightly build from this night and test a little bit more.
You mean if you refresh the page the changed image appears?
If you click on save and after waiting a few seconds click on close, the same?
The question is, if all is a problem with the asynchronous call. i.e. when loading the new page the changed image is not yet completely written to the server so the old is still loaded.
The message "Image saved" (or "Error") is really needed.
You mean if you refresh the page the changed image appears?
yes
If you click on save and after waiting a few seconds click on close, the same?
yes, the old image is displayed. After refresh the page the changed images appears.
The question is, if all is a problem with the asynchronous call. i.e. when loading the new page the changed image is not yet completely written to the server so the old is still loaded.
No message is displayed in the homepage. Only when i delete a picture then it shows "Item deleted". The developer console is empty.
Yes, image edit has no messages. The mentioned PR adds them. A small push for the idea ;) That PR depends though on the solution for browse IE11. I'll check if it's testable and let you know.
I've updated the repository and made a quick test. Works as expected.
It would be great if you can test. It seems to be more or less a Windows/Firefox problem. The coding should though still use callbacks or promises. Most developers use some other alien systems.
The repository -> here <-
The PR as above #561
Thanks, yes I will test soon.
I installed your repository and tested. The Save and Close button works good. But the image list is not refreshed. The old image is displayed. I do not know if this is relevant for your patch.
Only when I changed the image a second on and click the "save and close" button then the new image is displayed (image list).
Thanks for testing.
As you said, please open a new issue for "Not reloading saved images".
The changes in the PR are only for saving in the Edit view. It seems they are now always saved. If you open a changed image it is the changed one even if the "Image list" shows the old one.
Reloading of the images seems to be very random. In my quick test before asking you to test they really did load correctly. After testing a bit more I now can see that there are troubles with it. Sometimes the changed image appear sometimes the old. I so far can't find any pattern. The images must be buffered (cached) somehow and not reloaded from the server. Funny example: after a changed image correctly appeared it changed back to the old one after moving to a another directory and back. Open in the editor it was the changed one. A presidential muddle?
Is the browsers cache involved?
Vue.js is involved in the "Image list" so it's nothing for me. Not a clue,
As you said, please open a new issue for "Not reloading saved images".
I open a new issue this weekend.
No, this error is about the button "save & close".
The edited image is not saved after the click "save & close".
Would be raising a PR for that ASAP.
There are 2 problems.
- Asynchronous AJAX without using JS Promise or callbacks leads to not saved images. (browser dependent?) See the PR mentioned above.
- Browser caching makes reloading of saved image very random. I do not know why but that's the result of tests.
What I did was, first disable the currently opened tab, then close the window. Previously, they were directly closing without calling the disable function of individual plugin (Crop, Resize, Rotate).
This solved my issue at the time of development of Adaptive Images
I probably found an answer to why one browser saves the image and another not. In Chrome there is an option:
Background sync
Allow recently closed sites to finish sending and receiving data (recommended)
This should save the AJAX call from being interrupted. I do not know if other browsers have a corresponding setting.