projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
654cded
)
fix new installs vs. FKs, RT#13971
author
Ivan Kohler
<ivan@freeside.biz>
Tue, 2 Sep 2014 17:16:12 +0000
(10:16 -0700)
committer
Ivan Kohler
<ivan@freeside.biz>
Tue, 2 Sep 2014 17:16:12 +0000
(10:16 -0700)
FS/FS/Record.pm
patch
|
blob
|
history
diff --git
a/FS/FS/Record.pm
b/FS/FS/Record.pm
index
2005756
..
8f75734
100644
(file)
--- a/
FS/FS/Record.pm
+++ b/
FS/FS/Record.pm
@@
-1043,7
+1043,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
+1077,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