fixed several bugs related to SIG creation/deletion and a nasty brown paper
bag bug in Nuke Post!
This commit is contained in:
@@ -165,9 +165,9 @@ class SIGCoreData implements SIGData, SIGDataBackend
|
||||
this.engine = engine;
|
||||
this.datapool = datapool;
|
||||
this.sigid = sigid;
|
||||
this.created = (java.util.Date)(creation.clone());
|
||||
this.last_access = this.created;
|
||||
this.last_update = this.created;
|
||||
this.created = creation;
|
||||
this.last_access = creation;
|
||||
this.last_update = creation;
|
||||
this.read_level = DefaultLevels.newSIGRead();
|
||||
this.write_level = DefaultLevels.newSIGWrite();
|
||||
this.create_level = DefaultLevels.newSIGCreate();
|
||||
@@ -1800,7 +1800,7 @@ class SIGCoreData implements SIGData, SIGDataBackend
|
||||
Statement stmt = conn.createStatement();
|
||||
|
||||
// lock the tables we need to reference immediately
|
||||
stmt.executeUpdate("LOCK TABLES sigs WRITE, sigmember WRITE, sigtoconf READ;");
|
||||
stmt.executeUpdate("LOCK TABLES sigs WRITE, sigmember WRITE, confhotlist WRITE, sigtoconf READ;");
|
||||
try
|
||||
{ // first delete the SIG record itself
|
||||
stmt.executeUpdate("DELETE FROM sigs WHERE sigid = " + sigid + ";");
|
||||
@@ -1808,6 +1808,10 @@ class SIGCoreData implements SIGData, SIGDataBackend
|
||||
// now delete the members list
|
||||
stmt.executeUpdate("DELETE FROM sigmember WHERE sigid = " + sigid + ";");
|
||||
|
||||
// We need to make sure this SIG's conferences are removed from everyone's hotlist,
|
||||
// if they're present. (Bug #415474)
|
||||
stmt.executeUpdate("DELETE FROM confhotlist WHERE sigid = " + sigid + ";");
|
||||
|
||||
// determine the number of conferences in this SIG, and the maximum conference ID
|
||||
ResultSet rs = stmt.executeQuery("SELECT COUNT(*), MAX(confid) FROM sigtoconf WHERE sigid = "
|
||||
+ sigid + ";");
|
||||
|
||||
@@ -746,9 +746,10 @@ class TopicMessageUserContextImpl implements TopicMessageContext
|
||||
if (stmt.executeUpdate("DELETE FROM postpublish WHERE postid = " + postid + ";")>0)
|
||||
engine.unpublish(postid);
|
||||
|
||||
// Phase 1 of renumber - Renumber all posts that had a number higher than the one
|
||||
// we just blew to hell.
|
||||
stmt.executeUpdate("UPDATE posts SET num = (num - 1) WHERE num > " + x_post_num + ";");
|
||||
// Phase 1 of renumber - Renumber all posts IN THIS TOPIC that had a number higher than the one
|
||||
// we just blew to hell. (Must have the "topicid =" clause in there - see Bug #415473)
|
||||
stmt.executeUpdate("UPDATE posts SET num = (num - 1) WHERE topicid = " + x_topic_id + " AND num > "
|
||||
+ x_post_num + ";");
|
||||
|
||||
// Phase 2 of renumber - The topic now has one less post in it. Reflect that.
|
||||
stmt.executeUpdate("UPDATE topics SET top_message = (top_message - 1) WHERE topicid = "
|
||||
|
||||
@@ -193,6 +193,8 @@ public class SIGOperations extends VeniceServlet
|
||||
// present the "Create New SIG" dialog
|
||||
CreateSIGDialog dlg = makeCreateSIGDialog();
|
||||
dlg.setupDialog(engine);
|
||||
dlg.setFieldValue("language","en-US");
|
||||
dlg.setFieldValue("country","US");
|
||||
changeMenuTop(request);
|
||||
return dlg;
|
||||
|
||||
|
||||
@@ -108,7 +108,7 @@ public class NewSIGWelcome implements JSPRender
|
||||
|
||||
public String getDisplayURL(RenderData rdat)
|
||||
{
|
||||
return rdat.getFullServletPath(entry_url);
|
||||
return rdat.getCompleteServletPath(entry_url);
|
||||
|
||||
} // end getEntryURL
|
||||
|
||||
|
||||
@@ -149,6 +149,17 @@ public class RenderData
|
||||
|
||||
} // end getFullServletPath
|
||||
|
||||
public String getCompleteServletPath(String name)
|
||||
{
|
||||
StringBuffer buf = new StringBuffer("http://");
|
||||
buf.append(request.getServerName());
|
||||
if (request.getServerPort()!=80)
|
||||
buf.append(':').append(request.getServerPort());
|
||||
buf.append(request.getContextPath()).append('/').append(name);
|
||||
return buf.toString();
|
||||
|
||||
} // end getCompleteServletPath
|
||||
|
||||
public String getEncodedServletPath(String name)
|
||||
{
|
||||
return response.encodeURL(this.getFullServletPath(name));
|
||||
|
||||
Reference in New Issue
Block a user