projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FS RT #27208 - adding Mobile phone to FS::ConfDefaults::cust_fields_avail and related...
[freeside.git]
/
FS
/
FS
/
Record.pm
diff --git
a/FS/FS/Record.pm
b/FS/FS/Record.pm
index
2005756
..
c53c9ae
100644
(file)
--- a/
FS/FS/Record.pm
+++ b/
FS/FS/Record.pm
@@
-408,7
+408,6
@@
sub qsearch {
push @statement, $statement;
warn "[debug]$me $statement\n" if $DEBUG > 1 || $debug;
push @statement, $statement;
warn "[debug]$me $statement\n" if $DEBUG > 1 || $debug;
-
foreach my $field (
grep defined( $record->{$_} ) && $record->{$_} ne '', @real_fields
foreach my $field (
grep defined( $record->{$_} ) && $record->{$_} ne '', @real_fields
@@
-1043,7
+1042,10
@@
sub fk_methods {
my $method = '';
if ( scalar( @{$fk->columns} ) == 1 ) {
my $method = '';
if ( scalar( @{$fk->columns} ) == 1 ) {
- if ( ! @{$fk->references} || $fk->columns->[0] eq $fk->references->[0] ){
+ if ( ! defined($fk->references)
+ || ! @{$fk->references}
+ || $fk->columns->[0] eq $fk->references->[0]
+ ) {
$method = $fk->table;
} else {
#some sort of hint in the table.pm or schema for methods not named
$method = $fk->table;
} else {
#some sort of hint in the table.pm or schema for methods not named
@@
-1074,7
+1076,10
@@
sub fk_methods {
my $method = '';
if ( scalar( @{$fk->columns} ) == 1 ) {
my $method = '';
if ( scalar( @{$fk->columns} ) == 1 ) {
- if ( ! @{$fk->references} || $fk->columns->[0] eq $fk->references->[0] ){
+ if ( ! defined($fk->references)
+ || ! @{$fk->references}
+ || $fk->columns->[0] eq $fk->references->[0]
+ ) {
$method = $f_table;
} else {
#some sort of hint in the table.pm or schema for methods not named
$method = $f_table;
} else {
#some sort of hint in the table.pm or schema for methods not named