Skip to content
Snippets Groups Projects
Closed Invalid and patchy XML encoding causes Case crash if status is not valid XML
  • View options
  • Invalid and patchy XML encoding causes Case crash if status is not valid XML

  • View options
  • Closed Issue created by Rich

    Overview

    CiviCase will fail to fully create a CaseType if a Case Status' name is invalid in an XML context.

    Reproduction steps

    1. Create case status 'Signed & Sealed'
    2. Create case type
    3. Got an error about XML encoding

    Current behaviour

    The form errors and won't save. Yet it has half created a Case - it's there but has no description. This is massively confusing because it looks like it might have worked, but creates havock if you actually try to use that case type.

    Expected behaviour

    It should create the case type without error.

    Comments

    This happens because of some incomplete and rather lets-do-it-ourselves XML encoding. There's even a comment in the code saying "Ugh!" about this!

    The Statuses element was being written without being encoded, therefore & becomes an invalid entity.

    I have a PR for this that replaces the homemade XML encoding function with PHP's built in XML Writer objects.

    Linked items ... 0

  • Activity

    • All activity
    • Comments only
    • History only
    • Newest first
    • Oldest first
    Loading Loading Loading Loading Loading Loading Loading Loading Loading Loading