[rt-users] RTFM 2.0.4: Associating custom fields with classes
Teresa Carcelén Fernández
tcarcelen at gmail.com
Thu Apr 19 11:06:23 EDT 2007
Hi all,
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:
*System error*
*error:* Can't locate object method "HasEntry" via package
"RT::CustomFields" at
/usr/share/request-tracker3.4/html/RTFM/Admin/Classes/CustomFields.html
line 86.
*context:* *...*
*82:* # Go through and delete all the custom field relationships that
this class *83:* # no longer has *84:*
*85:*
*86:* if ($ClassCFs->HasEntry($cf->Id)) { *87:* unless (defined
$ARGS{"Class-".$ClassObj->Id."-CF-".$cf->Id} ) { *88:* my ($val, $msg) =
$cf->RemoveFromClass($ClassObj->Id); *89:* push (@results, $msg); *90:*
*...*
*code stack:* /usr/share/request-tracker3.4
/html/RTFM/Admin/Classes/CustomFields.html:86
/usr/share/request-tracker3.4/html/autohandler:215
I have added use RT::CustomFields but I have no sucess
use RT::FM::Class;
use RT::FM::CustomFieldCollection;
use RT::FM::ClassCustomField;
use RT::CustomField;
my $ClassObj = new RT::FM::Class( $session{'CurrentUser'} );
my ( $title, @results );
$ClassObj->Load($ARGS{'id'}) || $m->comp("/RTFM/Elements/Error", Why =>
"Couldn't load class '$id'");
my $ClassCFs = $ClassObj->CustomFields;
my $CustomFields = RT::FM::CustomFieldCollection->new(
$session{'CurrentUser'} );
$CustomFields->UnLimit;
$title = loc( 'Edit Custom Fields for Class [_1]', $ClassObj->Name );
if ($ARGS{'UpdateCFs'} ) {
while (my $cf = $CustomFields->Next) {
# Go through and delete all the custom field relationships that this
class
# no longer has
if ($ClassCFs->HasEntry($cf->Id)) {
unless (defined $ARGS{"Class-".$ClassObj->Id."-CF-".$cf->Id} ) {
my ($val, $msg) = $cf->RemoveFromClass($ClassObj->Id);
push (@results, $msg);
Can anyone help me?
Thanks in advance
Best Regards
Teresa
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20070419/dd8fcd5d/attachment.htm>
More information about the rt-users
mailing list