Discussion:
[Openinteract-dev] SPOPS bugs?
t***@onlink.net
2005-01-28 02:14:22 UTC
Permalink
1. has_a

In SPOPS::Manual::Relationship, the format is defined as:
has_a => { class-name => { method-name => 'id-field' } }
While in source SPOPS::ClassFactory::DefaultBehavior, it is coded as
$usea_id_field = ( keys %{ $usea_id_info } )[0];
$hasa_alias = $usea_id_info->{ $usea_id_field };
Which means
has_a => { class-name => { id-field => method-name } }


2. eval dbi error

In SPOPS::SQLInterface, prepare and excute are all evaled, and $@ are all checked after. But in many cases, when there was a SQL error generated, the program won't die, so the error would not be captured by eval. If the code check not only $@ but also $dbh->errstr, the problem will be fixed.


3. fetch_by

This is not really a bug. In my case, some fields are named like "customer#" in stead of customerNumber. This is really dump, but it is there already, I have no choice. Anyway this is what field_map come in for. If I directly put customer# into fetch_by, SPOPS::ClassFactory::DefaultBehavior will be broken. So if field alias is allowed in fetch_by, the problem will be fixed.
Loading...