Skip to content

Commit

Permalink
Fix unable to clone records with curvals containing created user field
Browse files Browse the repository at this point in the history
  • Loading branch information
abeverley committed Oct 28, 2024
1 parent d1f0f1b commit 04007f1
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions lib/GADS/Record.pm
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,12 @@ has created_user => (
builder => sub {
my $self = shift;

# Not yet defined for new record
return undef if $self->new_entry;

my $column = $self->layout->column_by_name_short('_created_user');

# Default to current user drafting record if new record
return $self->_person($self->user->id, $column)
if $self->new_entry;

my $value = $self->set_record_created_user || $self->record->{record_created_user};

# Has it been retrieved as part of sql query?
Expand Down Expand Up @@ -512,11 +513,12 @@ has edited_user => (
builder => sub {
my $self = shift;

# Not yet defined for new record
return undef if $self->new_entry;

my $column = $self->layout->column_by_name_short('_version_user');

# Default to current user drafting record if new record
return $self->_person($self->user->id, $column)
if $self->new_entry;

# Has it been retrieved as part of sql query?
if ($self->record && exists $self->record->{createdby})
{
Expand Down

0 comments on commit 04007f1

Please sign in to comment.