Hi all,<br>
I am running RTFM 2.0.4 and I have the following problem when I try to associate a Custom field (type TextSingle) to a class:<br>
<br>
<p align="center"><font face="Verdana, Arial, Helvetica, sans-serif"><b>System error</b></font></p>
<table border="0" cellpadding="1" cellspacing="0">
<tbody><tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>error:</b> </font></td>
<td align="left" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">Can't
locate object method "HasEntry" via package "RT::CustomFields" at
/usr/share/request-tracker3.4/html/RTFM/Admin/Classes/CustomFields.html
line 86.<br></font></td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>context:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
<table border="0" cellpadding="0" cellspacing="0">
<tbody><tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>...</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><br>
</td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>82:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> # Go through and delete all the custom field relationships that this class</font></td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>83:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> # no longer has</font></td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>84:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><br>
</td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>85:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> </font><br>
</td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>86:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><font color="red"> if ($ClassCFs->HasEntry($cf->Id)) {</font></font></td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>87:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> unless (defined $ARGS{"Class-".$ClassObj->Id."-CF-".$cf->Id} ) {</font></td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>88:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> my ($val, $msg) = $cf->RemoveFromClass($ClassObj->Id);</font></td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>89:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"> push (@results, $msg);</font></td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>90:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><br>
</td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>...</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><br>
</td>
</tr>
</tbody></table>
</font></td>
</tr>
<tr>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2"><b>code stack:</b> </font></td>
<td align="left" nowrap="nowrap" valign="top"><font face="Verdana, Arial, Helvetica, sans-serif" size="-2">
/usr/share/request-tracker3.4/html/RTFM/Admin/Classes/CustomFields.html:86<br>
/usr/share/request-tracker3.4/html/autohandler:215</font></td></tr></tbody>
</table>
<br>
I have added use RT::CustomFields but I have no sucess<br>
<br>
use RT::FM::Class;<br>
use RT::FM::CustomFieldCollection;<br>
use RT::FM::ClassCustomField;<br>
use RT::CustomField;<br>
<br>
my $ClassObj = new RT::FM::Class( $session{'CurrentUser'} );<br>
my ( $title, @results );<br>
$ClassObj->Load($ARGS{'id'}) || $m->comp("/RTFM/Elements/Error", Why => "Couldn't load class '$id'");<br>
my $ClassCFs = $ClassObj->CustomFields;<br>
my $CustomFields = RT::FM::CustomFieldCollection->new( $session{'CurrentUser'} );<br>
$CustomFields->UnLimit;<br>
$title = loc( 'Edit Custom Fields for Class [_1]', $ClassObj->Name );<br>
<br>
if ($ARGS{'UpdateCFs'} ) {<br>
while (my $cf = $CustomFields->Next) {<br>
# Go through and delete all the custom field relationships that this class<br>
# no longer has<br>
<br>
if ($ClassCFs->HasEntry($cf->Id)) {<br>
unless (defined $ARGS{"Class-".$ClassObj->Id."-CF-".$cf->Id} ) {<br>
my ($val, $msg) = $cf->RemoveFromClass($ClassObj->Id);<br>
push (@results, $msg);<br>
<br>
<br>
Can anyone help me?<br>
Thanks in advance<br>
Best Regards<br>
Teresa<br>
<br>