|
From: Chris W. <ch...@cw...> - 2003-04-03 03:24:47
|
(cc'd to oi-dev)
Ewa...@Be... wrote:
> on a table we're using 2 fields as an id-field. We modified the
> spops.perl and everything works fine ... but
>
> when using the result-Manager the produced files in the overflow
> directory shows something like that: class-->id1-->id2
>
> When trying to retrieve records (with CommonHandler) we get no search
> result. May be we found the reason for this problem:
>
> In the package /SPOPS/Iterator/DBI.pm the fetch_object method tries
> to fetch a record with id "id1-->id2" and not "id1,id2".
> (fetch('id1-->id2'))
> This doesn't work. Is this something which may be configured?
> At the moment we changed /SPOPS/Iterator/DBI.pm in the way that we
> substitute
> '-->' with ','
This is quite a coincidence -- two problems with exactly the same
solution in the same week. The problem is that the ->id call is
returning multiple values when we don't expect it.
Here's the offending line from OI::ResultsManage in the
results_manage package:
$out->print( join( $RECORD_SEP, $info{record_class},
$item->id ), "\n" );
Since $item->id is in list context, it returns a list of IDs which
then get join()ed by the record separator (-->). Changing it to:
$out->print( join( $RECORD_SEP, $info{record_class},
scalar( $item->id ) ), "\n" );
should take care of business. There was another use elsewhere in the
package that I changed also.
The updated results_manage package is up on Sourceforge. Thanks for
the report!
Chris
--
Chris Winters (ch...@cw...)
Building enterprise-capable snack solutions since 1988.
|