Commit 92c65524 authored by Anastasios Kalogeropoulos's avatar Anastasios Kalogeropoulos
Browse files

keep username on idea edit

parent e412b79b
......@@ -165,6 +165,8 @@ public class IdeaInputBean implements Serializable {
private boolean stepTwoVisited = false;
private boolean onLoadIdea = false;
@PostConstruct
public void postConstruct() {
......@@ -282,6 +284,7 @@ public class IdeaInputBean implements Serializable {
}
private void loadIdea(long ideasId){
this.onLoadIdea = true;
IdeasLocalService ideasLocalService = ideasLocalServiceTracker.getService();
UserLocalService userLocalService = userLocalServiceTracker.getService();
......@@ -854,7 +857,7 @@ public class IdeaInputBean implements Serializable {
this.dataUrl2 = null;
this.dataUrl3 = null;
this.ideasVideoInputStream = null;
this.onLoadIdea = false;
//Redirect
FacesContext context = FacesContext.getCurrentInstance();
ExternalContext externalContext = context.getExternalContext();
......@@ -1011,7 +1014,11 @@ public class IdeaInputBean implements Serializable {
idea.setLatitude(lat);
idea.setLongitude(lng);
idea.setPitch(pitch);
idea.setUserName(selectedUserName);
if(!this.onLoadIdea) {
idea.setUserName(selectedUserName);
}
else {
}
idea.setCategory(getCategoryPrimaryKeyForReceivedTitle(selectedCategory));
// Update the layout if title changed
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment