U4-1772 - cmsContentXml empty for media and members after republish

Created by Jeroen Breuer 23 Feb 2013, 15:13:18 Updated by Shannon Deminick 26 Apr 2013, 08:18:58

Relates to: U4-2144

Relates to: U4-493

Relates to: U4-2149

If you call /Umbraco/dialogs/republish.aspx?xml=true the following code is called:

public static void RePublishAll() { XmlDocument xd = new XmlDocument();

if (!DataLayerHelper.IsEmbeddedDatabase(SqlHelper.ConnectionString))
{
    SqlHelper.ExecuteNonQuery("truncate table cmsContentXml");
}
else
{
    SqlHelper.ExecuteNonQuery("delete from cmsContentXml");
}
IRecordsReader dr = SqlHelper.ExecuteReader("select nodeId from cmsDocument where published = 1");

while (dr.Read())
{
    try
    {
        new Document(dr.GetInt("nodeId")).XmlGenerate(xd);
    }
    catch (Exception ee)
    {
        Log.Add(LogTypes.Error, User.GetUser(0), dr.GetInt("nodeId"),
                string.Format("Error generating xml: {0}", ee));
    }
}
dr.Close();

}

This deletes the complete cmsContentXml table, but only rebuilds it for documents. The member and media xml should also be rebuild.

More info here: http://our.umbraco.org/projects/backoffice-extensions/digibiz-advanced-media-picker/digibiz-advanced-media-picker/38202-Images-disappeared-after-upgrade-to-25?p=1#comment139992

Comments

Shannon Deminick 24 Apr 2013, 22:53:42

It's not only if you call that method, it is if you change any document type/media type/member type alias!


Shannon Deminick 25 Apr 2013, 00:58:08

Fixed in 6a487f295f23 but will leave open until merged into main branch and then ported upwards to 6.x


Priority: Major

Type: Bug

State: Fixed

Assignee: Shannon Deminick

Difficulty: Normal

Category:

Backwards Compatible: True

Fix Submitted:

Affected versions: 4.8.0, 4.9.0, 4.10.0, 4.11.0, 6.0.0, 4.9.1, 4.11.1, 4.11.2, 4.11.3, 4.11.4, 6.0.1, 4.11.5, 6.0.2, 4.11.6, 6.0.3

Due in version: 6.0.6, 4.11.9

Sprint:

Story Points:

Cycle: