PDA

View Full Version : Mantis custom fields fail to fill in


Kevin McCoy
04-Nov-2008, 05:10 PM
Fabio,

I am having trouble with custom fields on Mantis. I can manually log in to Mantis, using the Eurekalog username/password and set a custom field called "hostname". Mantis sends me an email with "hostname" filled in properly on non-EL bug reports.

If however, I have an exception in my EXE and EL sends the error data to Mantis automatically, the field is left blank.

I am using Mantis v1.1.2 and EL v6.0.17 Enterprise.

I can provide WireShark TCP/IP dumps of the conversation between EL and Mantis if you like. In the TCP/IP dump it looks like EL is *trying* to fill in the custom field, but something must be going wrong on the Mantis side or with your web spider.

Here is my webfields handler:


PROCEDURE TMainForm.ExceptionWebFields(EurekaExceptionRecord : TEurekaExceptionRecord; WebFields : TStrings);
BEGIN
WebFields.Add(Format('hostname=%s', [GetMyHostName]));
END;


GetMyHostname returns a string containing the local machine's hostname.

Any ideas?

Contact me off the list if you'd like a username/password on my Mantis server for testing purposes.


Best regards,
Kevin G. McCoy

admin
05-Nov-2008, 09:55 AM
Hi Kevin,

can you send a test project to me at support@eurekalog.com please?

Kevin McCoy
05-Nov-2008, 06:10 PM
admin wrote:
Hi Kevin,

can you send a test project to me at support@eurekalog.com please?




check your mailbox :-)

admin
12-Nov-2008, 02:38 PM
Hi Kevin,

is not an EurekaLog bug but an your error.

Mantis uses as custom fields names custom_field_n name, so "hostname" is the field: custom_field_1 (not hostname).

That's all! :)

Kevin McCoy
13-Nov-2008, 04:50 PM
Fabio,

Yes, you are correct. My bad. :-)

Many thanks for your help!

For the lurkers, the correct Mantis custom WebFields function should
look something like this:

PROCEDURE TcwMainForm.EurekaWebFields(EurekaExceptionRecord :
TEurekaExceptionRecord; WebFields : TStrings);
BEGIN
WebFields.Add(Format('custom_field_1=%s', [GetMyHostName])); //
where custom_field_1 is the first Mantis custom field: Hostname
WebFields.Add(Format('custom_field_2=%s', [cwDm.OprLoginName])); //
where custom_field_2 is the second one: Username
END;

Obviously, if you use different tag names in Mantis, the meanings of the
Nth field will change and you'll have to index into them differently. I
have no idea why Mantis lets you create custom field *Names* and then
force you to index into them by creation order. Maybe its a PHP/HTML
form thing.

Best regards,

Kevin

admin wrote:

Hi Kevin,

is not an EurekaLog bug but an your error.

Mantis uses as custom fields names custom_field_n name, so "hostname" is the field: custom_field_1 (not hostname).

That's all! :)

admin
18-Nov-2008, 11:08 AM
Hi Kevin,

good notes! :)