Announcement

Collapse
No announcement yet.

Modification History, comma-handling

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Modification History, comma-handling

    ModHistory is very convenient. Thanks.

    Reporting two issues:

    Software Application: Modification History: current as of Jan 5, 2023
    System Context: HS4 4.2.16 running as a Windows 10 Service.
    Environment: HomeSeer log is clear at this time.

    1) Commas are parsed as delimiters, truncating the Description field of ModHistory.csv.
    2) The following error has occurred only one time. Uncertain what triggered it.

    Server Error in '/' Application.
    Index was outside the bounds of the array.
    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.

    Source Error:

    Line 143: sDescr = items(1)
    Line 144: sDescr = sDescr.Replace("|", ",")
    Line 145: sDate = items(2)
    Line 146: sb.Appendline("<tr><td class='tablecell'>" & sSoftChecked & "</td>")
    Line 147: sb.Appendline("<td class='tablecell'>" & sHardChecked & "</td>")

    Source File: C:\Program Files (x86)\HomeSeer HS4\html\ModHistory.aspx Line: 145

    Stack Trace:

    [IndexOutOfRangeException: Index was outside the bounds of the array.]
    ASP.modhistory_aspx.Page_Load(Object sender, EventArgs e) in C:\Program Files (x86)\HomeSeer HS4\html\ModHistory.aspx:145
    System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Obje ct sender, EventArgs e) +85
    System.Web.UI.Control.OnLoad(EventArgs e) +61
    System.Web.UI.Control.LoadRecursive() +98
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2645

    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4494.0​



    #2
    This was never my program. I just modified it to work on Linux. As the data is stored as a CSV file, commas are the issue. I expect it can be modified to replace commas to use its html equivalent so they don't break the CSV file. I would say the error is also related.
    Jon

    Comment


      #3
      Thanks Jon. The lightweight log is a nice concept. I can just copy the csv file - no problem if there is little interest and the fix is not worth the time.

      Dean

      Comment


        #4
        OK, had a quick look at this.

        Open ModHistory.aspx (html directory) in a text editor and find the line:

        sDescr = Request.Form("Descr")

        Replace it with:

        sDescr = Request.Form("Descr").Replace(",","&comma;")

        Then save.

        Open up ModHistory.csv (Config directory) in a text editor and repair it by removing the commas in the text you entered or replacing the comma with &comma;

        i.e. Hello, World would become Hello&comma; World.

        Save and it should now be able to use text with commas.
        Jon

        Comment

        Working...
        X