Skip to content
This repository has been archived by the owner on May 26, 2020. It is now read-only.

Image edit - save and close button not working #575

Open
TobsBobs opened this issue Aug 4, 2018 · 20 comments
Open

Image edit - save and close button not working #575

TobsBobs opened this issue Aug 4, 2018 · 20 comments

Comments

@TobsBobs
Copy link

TobsBobs commented Aug 4, 2018

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

fehler save and close_edit_0_edit_0

@schnuti
Copy link
Collaborator

schnuti commented Aug 5, 2018

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".

  1. Could you test with another browser e.g. Chrome or Edge,
  2. Could you open Firefox's Developer/Console Log to check for Javascript errors.

@TobsBobs
Copy link
Author

TobsBobs commented Aug 5, 2018

Hello @schnuti,

1
I get no js error in the console:
1

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.

@TobsBobs
Copy link
Author

TobsBobs commented Aug 5, 2018

I load the new nightly build from this night and test a little bit more.

@schnuti
Copy link
Collaborator

schnuti commented Aug 5, 2018

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.

@schnuti
Copy link
Collaborator

schnuti commented Aug 5, 2018

The message "Image saved" (or "Error") is really needed.

@TobsBobs
Copy link
Author

TobsBobs commented Aug 5, 2018

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.

@schnuti
Copy link
Collaborator

schnuti commented Aug 5, 2018

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.

@schnuti
Copy link
Collaborator

schnuti commented Aug 5, 2018

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

@TobsBobs
Copy link
Author

TobsBobs commented Aug 5, 2018

Thanks, yes I will test soon.

@TobsBobs
Copy link
Author

TobsBobs commented Aug 5, 2018

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).

@schnuti
Copy link
Collaborator

schnuti commented Aug 5, 2018

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,

@TobsBobs
Copy link
Author

TobsBobs commented Aug 8, 2018

As you said, please open a new issue for "Not reloading saved images".

I open a new issue this weekend.

@TobsBobs
Copy link
Author

TobsBobs commented Oct 7, 2018

Thanks @schnuti !

Any updates after two month with no response?

@laoneo
Copy link
Contributor

laoneo commented Oct 17, 2018

Is this not the same issue as #576?

@TobsBobs
Copy link
Author

No, this error is about the button "save & close".
The edited image is not saved after the click "save & close".

@kasvith
Copy link
Contributor

kasvith commented Oct 17, 2018

When we were completing adaptive images project we encountered same problem, @PRoman24 was able to solve it i guess. can you do a pr to it @PRoman24 ?

@geetanshu-m
Copy link
Contributor

Would be raising a PR for that ASAP.

@schnuti
Copy link
Collaborator

schnuti commented Oct 19, 2018

There are 2 problems.

  1. Asynchronous AJAX without using JS Promise or callbacks leads to not saved images. (browser dependent?) See the PR mentioned above.
  2. Browser caching makes reloading of saved image very random. I do not know why but that's the result of tests.

@geetanshu-m
Copy link
Contributor

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

@schnuti
Copy link
Collaborator

schnuti commented Oct 28, 2018

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.

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

No branches or pull requests

5 participants