On Tue, 2007-06-12 at 18:18 -0400, Jeff Platter wrote: > So I think I figured out what was going on. I have fixed the problem > for my RTFM situation but I need to know if what I did was the right > thing or not. So if one of the developers would like to look this over > that would be fantastic, and let me know if I broke anything else or > not. > > > > I found the problem to be that the format for > ProcessObjectCustomFieldUpdates in /rt3/ lib/RT/Interface/Web.pm. The > format for the custom object that it is expecting is: # format: > Object-<object class>-<object id>-CustomField-<CF id>-<commands> > > > > However when you load /rt3/share/html/RTFM/Article/Edit.html for the > first time to create an article there is no initial object id. So the > field end up being Object-<object class>--CustomField-<CF > id>-<commands> with a missing object id section. > > > > When ProcessObjectCustomFieldUpdates runs the first loop: > > foreach my $arg ( keys %$ARGSRef ) { > > # format: Object-<object class>-<object id>-CustomField-<CF > id>-<commands> > > next unless $arg =~ /^Object-([\w:]+)-(\d*)-CustomField-(\d > +)-(.*)$/; > > > > # For each of those objects, find out what custom fields we > want to work with. > > $custom_fields_to_mod{ $1 }{ $2 || 0 }{ $3 }{ $4 } = > $ARGSRef->{ $arg }; > > } > > > > It ends up setting the ID field to 0 cause it doesn’t exist. Then when > it loops through the class and id’s later and tries to get the > $Object: > > $Object->Load( $id ) unless ($Object->id || 0) == $id; > > > > It resets the object id to the wrong thing because the article has > already been created by this point and it has an id but the custom > fields don’t associate with that object id > > > > I don’t know if I’m making any sense with this anymore. > > > > Here is what I did to fix the issue: > > foreach my $arg ( keys %$ARGSRef ) { > > # format: Object-<object class>-<object id>-CustomField-<CF > id>-<commands> > > next unless $arg =~ /^Object-([\w:]+)-(\d*)-CustomField-(\d > +)-(.*)$/; > > > > my $Object = $args{'Object'} if exists $args{'Object'}; > > my $id = $Object->id || 0; > > > > # For each of those objects, find out what custom fields we > want to work with. > > $custom_fields_to_mod{ $1 }{ $2 || $id }{ $3 }{ $4 } = > $ARGSRef->{ $arg }; > > } > > > > I changed the first loop to pull the object if it was passed in and > set the id to the object->id or to 0. So it should default back to > what it was doing before if no object is currently passed in. > > > > Someone please take the time to read this and let me know if what I > did is good or not. If ne1 else is having this issue and needs a patch > file I can create one and send / post it somewhere, just lmk. > > > > Thanks for all the help this list has been so far. > > -Jeff > > > > From:[EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of Jeff > Platter > Sent: Tuesday, June 12, 2007 4:36 PM > To: rt-users@lists.bestpractical.com > Subject: [FILTER] [rt-users] Not saving custom fields in RTFM upon > Article creation > > > > > I’m using RTFM 2.2.0RC5 with RT 3.6.3. I have created a custom field > for the body of the article. I have setup all permissions on the > custom field and added it to the class that I want it in. When > creating a new article it doesn’t save the value of the custom field > that I have. I have to go back in to the article and modify the field > and then it saves ok. > > > > Is this a bug or is there a setting that I’m missing? > > > > Thanks, > > -Jeff
Hi, Jeff, thanks very much for this email. It solved the problem we were having with RTFM too when upgrading from 3.4 to 3.6 and trying to extract RTFM articles. Has this been verified as a bug, or is there possibly something wrong with my installation? Currently running RT 3.6.4 and RTFM 2.2.0RC5. Also had the same problem with RT 3.6.4 and RTFM 2.0.4. With this patch for now it appears that all is working flawlessly. Thanks to all on the list for help and to the devs for a great product in RT and RTFM, Dave Patch generated from Jeff's suggestions: [EMAIL PROTECTED] Interface]# diff -u Web.pm.20070706 Web.pm --- Web.pm.20070706 2007-07-06 09:34:50.000000000 -0400 +++ Web.pm 2007-07-06 09:36:36.000000000 -0400 @@ -1198,8 +1198,14 @@ # format: Object-<object class>-<object id>-CustomField-<CF id>-<commands> next unless $arg =~ /^Object-([\w:]+)-(\d*)-CustomField-(\d +)-(.*)$/; + # added by dbh for rtfm issue + my $Object = $args{'Object'} if exists $args{'Object'}; + my $id = $Object->id || 0; + # For each of those objects, find out what custom fields we want to work with. - $custom_fields_to_mod{ $1 }{ $2 || 0 }{ $3 }{ $4 } = $ARGSRef->{ $arg }; + #$custom_fields_to_mod{ $1 }{ $2 || 0 }{ $3 }{ $4 } = $ARGSRef->{ $arg }; + # this line modified by dbh too, for rtfm issue + $custom_fields_to_mod{ $1 }{ $2 || $id }{ $3 }{ $4 } = $ARGSRef->{ $arg }; } # For each of those objects
_______________________________________________ http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users Community help: http://wiki.bestpractical.com Commercial support: [EMAIL PROTECTED] Discover RT's hidden secrets with RT Essentials from O'Reilly Media. Buy a copy at http://rtbook.bestpractical.com