PATCH: RT 3.6.0 REST interface - hard-coded value prevents extension of REST API - REPOST in UDIFF format

When extending the REST API for the AT extension, I came across this
problem. I hope I’ve diagnosed it correctly. This patch certainly fixes
the problem and doesn’t seem to cause any other problems. I’ve been
using the patch for several months now.

To reproduce

/usr/local/rt/bin/rt create -t asset set Name=test9 Status=qa
Type=Servers # Unknown object type: Servers

Comments

This is a problem in $rtroot/share/html/REST/1.0/dhandler at line 144

$k->{type} never exists as this would be a CLI Field=Value setting and
there is no “Type” field for any RT types. This would normally go
unnoticed. However, in AT, “Type” is an Asset subtype and hard-wired as
a basic field type for all Assets. Looking for a “Type” form field to
set the RT object type finds this and sets it to something that is an
unknown RT object type (like “Servers” or “Storage” for example).

Philip Kime

dhandler.patch (483 Bytes)