[Rt-devel] User Custom Fields not being displayed??

Kevin Falcone falcone at bestpractical.com
Fri May 28 14:02:10 EDT 2010


On Fri, May 28, 2010 at 01:53:35PM -0400, Brian D wrote:
> 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.  

a) Why do you think $UserObj is the CurrentUser?
b) Have you gone to Configuration -> Global -> Custom Fields -> Users
and applied your custom fields?

-kevin

> 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) %>:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-devel/attachments/20100528/136354c3/attachment.pgp>


More information about the rt-devel mailing list