Invalid and patchy XML encoding causes Case crash if status is not valid XML
View options
- Truncate descriptions
Overview
CiviCase will fail to fully create a CaseType if a Case Status' name is invalid in an XML context.
Reproduction steps
- Create case status 'Signed & Sealed'
- Create case type
- 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.
- Show labels
- Show closed items