Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# tigermain 7/20/2007 12:33 PM

If you are trying to delete a non-node specific section, there is an error as the current code does not remove the section from any attached templates (have not tested with nodes), here is the change that I have implemented to fix this issue

\Web\Admin\Sections.aspx.cs
		private void rptSections_ItemCommand(object source, System.Web.UI.WebControls.RepeaterCommandEventArgs e)
		{
			int sectionId = Int32.Parse(e.CommandArgument.ToString());
			Section section = (Section)base.CoreRepository.GetObjectById(typeof(Section), sectionId);

			if (e.CommandName == "Delete")
			{
				try
				{
					// First tell the module to remove its content.
					ModuleBase module = this.ModuleLoader.GetModuleFromSection(section);
					module.DeleteModuleContent();

                    // Remove from all template sections
                    IList templates = this.CoreRepository.GetTemplatesBySection(section);
                    foreach (Template template in templates)
                    {
                        string attachedPlaceholderId = null;
                        foreach (DictionaryEntry entry in template.Sections)
                        {
                            if (entry.Value == section)
                            {
                                attachedPlaceholderId = entry.Key.ToString();
                                break;
                            }
                        }
                        template.Sections.Remove(attachedPlaceholderId);
                        base.CoreRepository.UpdateObject(template);
                    }

					// Now delete the Section.
					base.CoreRepository.DeleteObject(section);
				}
				catch (Exception ex)
				{
					ShowError(ex.Message);
					log.Error(String.Format("Error deleting section : {0}.", section.Id.ToString()), ex);
				}
			}
			BindSections();
		}
	}
# Efie 7/20/2007 1:35 PM
I've seen several of your posts on this forum with bugfixes/feature requests.

When your submitting them on the forum they will never make it into a new release of Cuyahoga. You should submit bugfixes/feature requests in the issue tracker, then will be decided to solve or add the feature in a next version.

http://tijnthuus.demon.nl:8080/jira/secure/Dashboard.jspa

You should register to submit issues.
# tigermain 7/20/2007 2:00 PM
Ah thanks hadn't realised that, but tbh Im not too bothered as we have branched the system that much from version 1.5 I wont be able to upgrade