[Rt-devel] User Custom Fields not being displayed??
Brian D
bjd-dev at simplicity.net
Fri May 28 13:53:35 EDT 2010
Anyone else using User Custom Fields?
I was trying to get them to work in a 3.8.6 instance, but they do not
appear in the User's CustomFields box.
I took a look at what Admin/Users/Modify.html is doing to display the
fields and noticed that it is trying to list the fields of the
CurrentUser, rather than looping through all fields available for
users. I modified this code as shown below and now I can see the
custom fields, but I'm running into errors when I set them from the
UI. I set one of these fields from the backend and had it populate
the selected item properly, so I know I'm getting close. I just
figured I'd ping to see if anyone else has run into this. I didn't
see any changes in 3.8.8 relevant to this code.
The error that I'm getting on updates is:
Custom field RT::CustomField=HASH(0x7f0835dfcc88) does not apply to this object
--- Modify.html~ 2009-11-20 14:19:31.000000000 -0500
+++ Modify.html 2010-05-28 13:37:19.282276082 -0400
@@ -208,7 +208,9 @@
<br />
<&| /Widgets/TitleBox, title => loc('Custom Fields') &>
<table>
-% my $CFs = $UserObj->CustomFields;
+% my $CFs = new RT::CustomFields($session{'CurrentUser'});
+% $CFs->LimitToLookupType( 'RT::User' );
+%# $UserObj->CustomFields;
% while (my $CF = $CFs->Next) {
<tr valign="top"><td align="right">
<% loc($CF->Name) %>:
More information about the rt-devel
mailing list