Skip to content

Attempting to Email Admin Logs Returns 500 Error #5573

@mwigley-trilogy

Description

@mwigley-trilogy

Description of bug

The email function to send Admin Logs returns a 500 Error even if SMTP is configured and tested to be working.

image

Steps to reproduce

  1. Enable SMTB, test that it's working correctly
  2. Open Manage=> Admin Logs
    image
  3. Select some log lines, click 'Email Selected', and attempt to send the email
    => Email fails to send with a server error.

Current behavior

When attempting to email admin logs, it fails with a server error.

Expected behavior

It should be possible to email admin logs.

Screenshots

(posted inline above)

Error information

{
    "Message": "An error has occurred.",
    "ExceptionMessage": "Cannot import nodes of type 'Document'.",
    "ExceptionType": "System.InvalidOperationException",
    "StackTrace": "   at System.Xml.XmlDocument.ImportNodeInternal(XmlNode node, Boolean deep)\r\n   at Dnn.PersonaBar.AdminLogs.Components.AdminLogsController.GetExceptions(IEnumerable`1 logIds) in C:\\DNN\\Dnn.Platform\\Dnn.AdminExperience\\Dnn.PersonaBar.Extensions\\Components\\AdminLogs\\AdminLogsController.cs:line 270\r\n   at Dnn.PersonaBar.AdminLogs.Components.AdminLogsController.EmailLogItems(String subject, String fromEmailAddress, String toEmailAddress, String message, IEnumerable`1 logItemIds, String& error) in C:\\DNN\\Dnn.Platform\\Dnn.AdminExperience\\Dnn.PersonaBar.Extensions\\Components\\AdminLogs\\AdminLogsController.cs:line 224\r\n   at Dnn.PersonaBar.AdminLogs.Services.AdminLogsController.EmailLogItems(EmailLogItemsRequest request) in C:\\DNN\\Dnn.Platform\\Dnn.AdminExperience\\Dnn.PersonaBar.Extensions\\Services\\AdminLogsController.cs:line 182"
}

Additional context

It fails at line 270 of AdminLogsController:

var objNode = objXml.ImportNode(xmlDoc, true);

should be:

var objNode = objXml.ImportNode(xmlDoc.DocumentElement, true);

I'll have a PR up to fix this shortly.

Affected version

  • 10.00.00 alpha build
  • 09.11.01 latest supported release

Occurs in at least 9.10 and 9.11, code hasn't been changed recently so will occur in any alpha builds too

Affected browser

Any

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions