Hi,
I have been developing a view with a form that posts some data with the corresponding action that udpates the database with the data, pretty straighforward. However, I've noticed that the status of the action is never 200OK, but always 302 Moved Temporarily. This happens regardless of whether I use ajax or not and regardless of whether the action is "get" or "post". The action does get executed, the database is updated, but the status is always "302". After struggling with this for a while, I've started looking at how other forms are implemented in elgg and realized that all forms that I saw so far return the same status on submit! It includes logging in, updating the profile, all the most basic forms in elgg! Despite this, my site seems to be functioning ok. The only reason I noticed this to begin with is because my form used ajax and since the action never returned the 200 OK success status, I could never execute whatever I needed to be executed when the ajax completes its action.
Any ideas how to investigate this??
Thanks!
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- Cash@costelloc
Cash - 0 likes
- Ezhi@EzhihaVTumane
Ezhi - 0 likes
You must log in to post replies.Elgg sends a 302 at the end of every action. The php function that Elgg defines is called forward(). The redirect takes the user to the new page after the action completes.
For ajax actions, I put an exit at the end of the action script to prevent the forward from occuring. Elgg needs to provide better ajax support. This is a known issue. There have been some discussions on this in the Elgg developers group recently: http://groups.google.com/group/elgg-development/browse_thread/thread/4ebd259f1e194f10
Thank you so much!! This is exactly what I needed.