Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • C CiviCRM Core
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,376
    • Issues 1,376
    • List
    • Boards
    • Service Desk
    • Milestones
  • Deployments
    • Deployments
    • Releases
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Development
  • CiviCRM Core
  • Issues
  • #1719

Closed
Open
Created Apr 17, 2020 by Rich@artfulrobotDeveloper

Invalid and patchy XML encoding causes Case crash if status is not valid XML

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.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking