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

Error reporting should not use "redirect" #7

Open
delaitre opened this issue Mar 25, 2010 · 2 comments
Open

Error reporting should not use "redirect" #7

delaitre opened this issue Mar 25, 2010 · 2 comments
Labels

Comments

@delaitre
Copy link
Collaborator

When an error occurs, the plugin use the "redirect" mechanism which doesn't work as expected sinces a lot of call are made with AJAX (the "redirected to" page is displayed in the time tracker div instead of having a real redirection).

A proper solution must be find (any idea ?)

@sayyid
Copy link

sayyid commented Feb 16, 2011

I don't know your mechanism for displaying the data in the time tracker div. Do you use redmine's javascript libraries for doing that, or you collect the AJAX response, and put it there yourself? If latter is true, you can put some "status" in the response, and make your decision based on the status at the client side. If status is error, an error should be displayed (e.g. via a modal dialog (if we want to be sure that the user sees the message)). Otherwise, data should go directly in the time tracker div.
If redirect is needed, status could be "redirect" and the data could be the address to redirect to. Now when the JS sees this status, it will redirect (in javascript) to the url specified in the data.
I don't know much about redmine coding system (specially about the javascript and AJAX part). Maybe a solution to this problem already exists in it's library and I'm making it too hard to do that!

@delaitre
Copy link
Collaborator Author

Well, I don't know much about redmine, ruby and rails too...

If I remember correctly, when redirect is needed, I use the rails' redirect function, otherwise, I just send back AJAX data with the rails mechanism.
The use of a "status" in AJAX response is what I had in mind to implement a proper error handling.
At the present time, the rails 'flash' is use for the errors, but it doesn't work with AJAX. When I have written that, flash and ajax mechanism was quite obscure to me...

It should not be very hard to cleanup all this things but I have no time right now. Moreover, this is not in my priority list for the plugin as error should not happen if you don't do weird actions (like starting a tracker in a tab, and starting another one in another tab).

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

No branches or pull requests

2 participants