Re: [Arsperl-users] Problem with 7.x enum list with gaps
Brought to you by:
jeffmurphy
|
From: Thilo S. <thi...@ap...> - 2007-08-27 08:38:40
|
For the 'Enum With Gaps' field, you have to use
$field->{limit}{enumLimits}{customList}
instead of
$field->{limit}{enumLimits}{regularList}
Regards,
Thilo
Michiel Beijen wrote:
> Excuse me, here is my message one more time. sf.net keeps sending
> messages to me that they've blocked and removed .zip and .pl
> attachments.
>
> I guess I also ran into a problem with the 7.x Enum field when it
> contains gaps and I have attached a .def file and a perl script to
> explain it.
> The list of enum values that is returned when you do an ars_GetField
> call on a enum field with gaps between the values is empty.
>
> Regards,
>
> Michiel
>
> Here's the perl script:
>
> ---------
> use ARS;
> use strict;
> use warnings;
> use Data::Dumper;
>
> my $ctrl = ars_Login( shift, shift, shift )
> || die "login: $ars_errstr";
>
> my $schema = "MB:Test";
>
> foreach ('Conventional Enum', 'Enum With Gaps') {
> print "Fetching values for $_\n";
> ( my $fid = ars_GetFieldByName( $ctrl, $schema, $_ ) ) || die $ars_errstr;
> ( my $field = ars_GetField( $ctrl, $schema, $fid ) ) || die $ars_errstr;
> print Dumper ( @{ $field->{limit}{enumLimits}{regularList} } );
> my @enumvals = @{ $field->{limit}{enumLimits}{regularList} };
> print "Status values $_: " . join( ',', @enumvals ) . "\n";
> }
>
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Arsperl-users mailing list
> Ars...@ar...
> https://lists.sourceforge.net/lists/listinfo/arsperl-users
|